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 does not automatically reload changes in PUG file in the browser #5134

Closed
Doogiemuc opened this issue Sep 12, 2020 · 1 comment
Closed

Comments

@Doogiemuc
Copy link

🐛 bug report

I have the simplest possible hello world setup with PUG files:

index.pug

html
body
  h1 Hello World Header
  script src="./script.js"

script.js

console.log('hello world')

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

all default, most current version of parcel-bundler

CLI Command: parcel index.pug

🤔 Expected Behavior

View in browser should be updated when content of index.pug is changed.

😯 Current Behavior

  1. Change content of index.pug, e.g. change the "Hello World Header"
  2. Save the file
  3. The parcel server actually dedetects the file change and rebuilds the files
  4. But the browser does not automatically reload. (tested infirefox and chrome)

💁 Workaround

When manually reloading the new content is shown.

@Doogiemuc
Copy link
Author

SOLVED

You must include a "dummy" script. Also when using PUG. #83, #90, #558 still seem to be an issue although closed.

But you must do that correctly in PUG :-) I had a typo above. Missing brackets in the pug script tag:

html
body
  h1 Hello World Header
  script(src="./script.js")  // <== need brackets here

The hot reloading the page autoamtically in the browser wordks.

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