-
Notifications
You must be signed in to change notification settings - Fork 71
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
svelte3 support #74
Comments
HMR is not supported for svelte v3 yet. |
Considering switching from Vue/Nuxt to Svelte. But lack of Hot reloading is really a bummer. Watching this |
@ekhaled's solution solved the following problem for me: Mounting a (Svelte) component that didn't import any other components worked all right. But once I started importing other components, things went awry, with the following messages showing up in the app's console:
Just posting to make it easier for people to reach this issue by searching. |
Just making sure, is HMR still not supported for Svelte 3? The docs seem to suggest that If so, I'd be happy to put up a little PR to make a note that Svelte 3 HMR is incoming, so future people don't spend time trying to debug why HMR isn't working. Also, thanks for this great tool! |
@Vages Formerly I had the same problem with you, but it finally solved it by doing these:
|
Thanks for the advice, @gui-killer. I'm sure it will be of help the next time I use it. However, the project in question needed the webpack-dev-server entry-point and hot=true in webpack dev server because some other frameworks we used at the same time required it. |
As a newbie to Svelte, I'm going to leave this here in case it prompts someone with more experience to have insight. Maybe we can crowdsource a solution. The error for me is:
... which is thrown in the source Along the stack trace (...
There is no The code fragment surrounding line
It seems that
does not throw, since |
As for the next error, for me it is:
The first entry in the stack trace leads to this line
which is in the constructor for
because I suspect that But, again, I know very little about the codebase, so it may not fix the error in Edit: I created a PR referencing this comment, where I make the suggested change: ekhaled/svelte-dev-helper#14
|
@rendall Hey! I went down a very similar path as you some time ago. Indeed, there are not a whole lot of things to adapt in this codebase to make it work with Svelte 3. Eventually this led me to the development of svelte-hmr. You may want to check the README of this project. We now have community plugins with HMR support both for Webpack and Rollup, and even super fast, almost instant, options with Nollup and Svite! If you're interested in contributing to HMR, you might want to check what can be enhanced in those projects, instead of doing it all from scratch again ;) |
@rixo Coo'. I swapped in I do feel a bit of an obligation to help out here, where possible, but now I can hot reload. Groovy. |
@rendall BTW if you're in search of a Svelte HMR challenge for yourself, there is the Sapper + Nollup + HMR thing that I've been meaning to address but lacked time thus far... I've got a POC working, and we want to go the rest of the way by integrating that cleanly into Sapper (and this requires discussion and PR at Nollup too). @antony was interested in working on this, especially on the Sapper part. There's been some discussion, and link to my POC is available in this issue: sveltejs/sapper#1207 (comment) I'm mentioning this because this work seems very much aligned with the debugging skills you've displayed previously. Maybe that's something you'll want to play with :) |
Closing as duplicate of #92 |
Have this error with svelte3:
proxy.js:135 TypeError: Class constructor SvelteComponentDev cannot be invoked without 'new' at new Layout (_layout.html:2) at proxyComponent._register (proxy.js:128) at new proxyComponent (proxy.js:54) at render (client.js:183) at client.js:148
looks like problem with svelte-dev-helper. How i can resolve it?
The text was updated successfully, but these errors were encountered: