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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken hot reload when using workaround for #44 #49

Closed
zastrowm opened this issue May 24, 2019 · 1 comment
Closed

Broken hot reload when using workaround for #44 #49

zastrowm opened this issue May 24, 2019 · 1 comment

Comments

@zastrowm
Copy link

馃悰 Workaround Report for #44

Like issue #44, I got the Class constructor SvelteComponent cannot be invoked without 'new' error; applying the workaround mentioned for a modern browser via browserslist:

"browserslist": [
    "edge >= 13"
  ]

gets things working in parcel, but as comment on #44 mentions, it completely breaks HMR.

Looking at svelte-asset.js I found that if you stop calling makeHot, then the browser refreshes as normal.

i.e. remove these lines:

if (process.env.NODE_ENV !== 'production' && this.options.hmr) {
code = makeHot(compilerOptions.filename, code, this);
}

And then modifying a svelte file does refresh the browser.

馃實 Your Environment

  • Windows OS
  • parcel-bundler: 1.12.3
  • svelte: 3.4.2
@samuelgozi
Copy link
Contributor

A temporary solution would be to turn off HMR entirely by adding the --no-hmr flag to the parcel command.
I will add a pull request for a fix later today.

DeMoorJasper pushed a commit that referenced this issue Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants