-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
When changing bundle-text imported css there is no hot styling reloading happening #6506
Comments
Ideally, This way, you could in theory still have it update without a page reload by setting |
Yo this issue still persists and it seems to have gotten worse? Previously some parts of my JS were still re-executed when I saved the CSS so I could trigger a pageload from there, but now it seems to do nothing except clearing the console. I just found https://parceljs.org/features/development/#hot-reloading and there it says
But I don't do any module.hot stuff and it doesn't reload. I just tried doing the module.hot.accept() thing and it didn't trigger on the CSS :( Unrelated: I've been trying some react stuff and I occassionally got |
Yeah same issue here. As a stop-gap Is there any way to keep old school reloading but disable HMR? |
the module.hot stuff in the documentation doesn't trigger at all when css is changed, however, lucky for me the dom still mutates and is updated with a new uid on the css url. here's a quick hack that'll reload when the head changes. it'll work for now but there really does need to be a way to just force reloads imo. let index = 0
const observer = new MutationObserver(function () {
if (index++ > 2) {
window.location.reload()
}
})
observer.observe(document.head, { childList: true }) |
I have the same problem here, I'm trying to have a custom html component with is shadow dom, and I wanted to import the css as text to attach him to the shadow root as as a style tag, but it fails to reload whenever i edit the css files imported as a bundle-text |
When I do: import css from 'bundle-text:./style.scss' and then change if I change When I do: const css = await import('bundle-text:./style.scss')
Parcel makes it impossible to hot-reload CSS by not only failing to update dependents, but even if dependents are manually updated, using a perma-cached string anyway. Passing Surely this is not intended. @mischnic |
🐛 bug report
npm install
npm run serve
http://localhost:1234/main.js
into a page.-> nothing happens
🎛 Configuration (.babelrc, package.json, cli command)
See .zip file
🤔 Expected Behavior
Either somehow the code inserting the styling magically gets reran or the page just reloaded.
😯 Current Behavior
Some code for bundling style assets with a HTML page is ran and removes and re-adds all elements to the page but it doesn't help - nothing happens
💁 Possible Solution
Simplest solutions is to just reload the page, the same that happens if you edit src/main.ts
🔦 Context
Have script with bundle-text'ed css, need to manually reload each time.
💻 Code Sample
parcel-no-bundle-text-css-hmr.zip
🌍 Your Environment
The text was updated successfully, but these errors were encountered: