parcel: Reloading is not working for changes inside folder

🐛 bug report

I have a very simple scenario: My project folder has only an index.html in the root and an index.js in the src folder. I run the development server with: parcel index.html Then when I make changes in the src/index.js file the page doesn’t reload its content. Even if I refresh my browser manually the content doesn’t change. I’ve tested the same scenario but with index.js in the root folder, and it works perfectly.

🎛 Configuration (.babelrc, package.json, cli command)

package.json

{
  "name": "parcel-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

🤔 Expected Behavior

😯 Current Behavior

💁 Possible Solution

🔦 Context

🌍 Your Environment

Software Version(s)
Parcel 1.3.0
Node v8.9.1
npm/Yarn npm 5.6.0
Operating System Ubuntu 16.04

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (5 by maintainers)

Most upvoted comments

@DeMoorJasper that’s exactly the same problem I was having. I’m using Vim and after I changed my .vimrc file to include these lines:

set nobackup
set nowritebackup

the problem is solved. Thank you guys.

Don’t worry, there are no stupid bug reports. Whatever you’re experiencing, some other user will experience it too. It’s useful for us to either provide a google trail for them to follow (here) or update the documentation.

On Fri, Dec 22, 2017 at 11:05 AM, Bruno C. Couto notifications@github.com wrote:

I’m using Google Chrome 63.0.3239.108

Man it looks like I’m doing something very stupid but I can’t figure out what it is. But I’m going to try with the latest HEAD to check it out.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/parcel-bundler/parcel/issues/382#issuecomment-353638342, or mute the thread https://github.com/notifications/unsubscribe-auth/AADo8HZqwj4wIBtfNgp2gp2boDll1Wtqks5tC-F3gaJpZM4RLIDS .

Every time I use Parcel, I need to dig up this issue and solve the problem again.

Why do I have this problem with Parcel only?

Never had this problem with e.g. webpack or rollup.

It seems a bit problematic that failure is the default for people working with (at least) any of the JetBrains IDEs or VS Code on PC, probably others. 🤔

I’m using Parcel and I also have this problem and no matter how much I modified my .js file it didn’t modify in the browser. I used CRTL +SHIFT + R. Which forcefully reloads the page. It worked, but it is annoying to use it every time.

The solution I found. It is in the official Parcel documentation. https://parceljs.org/features/development/ It talks about the cache folder, which is created by parcel, to not use it you just have to append --no-cache inside the execution of your yarn or npm command.

I modified my ‘scripts’ inside my package.json file by inserting the --no-cache .

"scripts": { "start": "parcel --no-cache", "build": "parcel build" }

Now to start my development server I just use yarn start

I hope this is helpful. Greetings, good luck with your developments friends.

Try running parcel --no-cache index.html. Does that fix the issue?

On Fri, Dec 22, 2017 at 10:33 AM, Bruno C. Couto notifications@github.com wrote:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script src="./src/index.js"></script> </body> </html>

I’ve already tested using <script src="src/index.js"></script> and it gets the same problem. It initially gets the right content, but it do not update when I change the index.js file.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/parcel-bundler/parcel/issues/382#issuecomment-353632277, or mute the thread https://github.com/notifications/unsubscribe-auth/AADo8GhXV_VDbaKJr0gIB1s3sEkKa5Ihks5tC9m9gaJpZM4RLIDS .

The problem is also in version 2.5.0, files that are on root folder are the ones that get reload

works on PC but not on a MAC

I’m using Google Chrome 63.0.3239.108

Man it looks like I’m doing something very stupid but I can’t figure out what it is. But I’m going to try with the latest HEAD to check it out.