Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parcel crashes when editing file #10029

Open
Ascyt opened this issue Dec 3, 2024 · 0 comments
Open

Parcel crashes when editing file #10029

Ascyt opened this issue Dec 3, 2024 · 0 comments

Comments

@Ascyt
Copy link

Ascyt commented Dec 3, 2024

🐛 bug report

Parcel crashes when I edit ./src/index.html while it is running.

🎛 Configuration (package.json)

{
  "name": "presentation_employer-banding",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build:scss": "sass src/scss:dist/css",
    "build:ts": "tsc",
    "start": "parcel src/index.html",
    "build": "parcel build src/index.html"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "reveal.js": "^5.1.0",
    "sass": "^1.81.1",
    "typescript": "^5.7.2"
  },
  "devDependencies": {
    "@parcel/transformer-sass": "^2.13.2",
    "parcel": "^2.13.2"
  }
}

🤔 Expected Behavior

Parcel should keep running and reload the project with the new index.html.

😯 Current Behavior

Parcel crashes when I edit ./src/index.html and to get the new index.html in my browser I have to run npm start again.

> npm start

> [email protected] start
> parcel src/index.html

Server running at http://localhost:1234
⠋ Building index.html...
node:fs:1878
  binding.unlink(path);
          ^

Error: ENOENT: no such file or directory, unlink 'C:\Users\filip\AppData\Local\Temp\index.html.42764.11'
    at Object.unlinkSync (node:fs:1878:11)
    at WriteStream.<anonymous> (C:\Users\filip\Documents\Presentations\4CHIF_BWMBO_Employer-Branding\node_modules\@parcel\fs\lib\index.js:1142:83)
    at Object.onceWrapper (node:events:633:26)
    at WriteStream.emit (node:events:530:35)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'unlink',
  path: 'C:\\Users\\filip\\AppData\\Local\\Temp\\index.html.42764.11'
}

Node.js v20.11.1
PS C:\Users\filip\Documents\Presentations\4CHIF_BWMBO_Employer-Branding> 

It does work initially, it just crashes when I edit the index.html file while parcel is running.

💁 Possible Solution

It probably has to do something with the fact that I'm using Windows and that for some reason it can't really find that file in the temp folder. Not sure exactly, though.

🔦 Context

I'm trying to set up reveal.js with parcel.

💻 Code Sample

File structure:

package-lock.json
package.json
tsconfig.json

src/
	index.html <- Error happens when I change this file 
	
	assets/
		background.png
	scss/
		style.scss
	ts/
		main.ts <- Changing this for example works
		reveal.d.ts
		
	dist/
		...
	node_modules/
		...
	.parcel-cache/
		...

tsconfig.json:

{
  "compilerOptions": {
    "target": "es2016",
    "module": "commonjs",
    "rootDir": "./src",    
    "outDir": "./dist",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true
  },
  "include": ["src/**/*"]
}

If more is needed let me know. Though I don't want to give away every detail from the project.

🌍 Your Environment

Software Version(s)
Parcel ^2.13.2
Node v20.11.1
npm 10.2.4
Operating System Windows 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant