intrnl/vite-plugin-svelte

JS HMR Error

nym21 opened this issue · 6 comments

nym21 commented

Hi again,

With the latest vite version (> 1) there seems to an error while updating a JS file. Everything works fine with vite 0.20.8

Not sure, who's fault it is, just wanted to point it out

(node:96970) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
    at Set.has (<anonymous>)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:145:31)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
    at walkImportChain (/Users/k/code/quickbook/app/node_modules/vite/dist/server/serverPluginHmr.js:169:22)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:96970) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:96970) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I've tried your app (very cool by the way 👍) but I haven't been able to replicate the same issue. I do notice that Vite has been throwing a lot of unoptimized deps warnings though which I didn't catch.

Thanks, still very buggy and unfinished haha

I'll try again then maybe I did something wrong the first time, if not, I'll post a small repo here

Not sure what I did but everything is fine now !

Actually, there is indeed an error when changing a js file that is being imported in too many places (I suppose it's the problem)

If you clone quickbookio/app and start it, go to the app page, then run save in src/js/page.js you'll see the error. If you prefer I can try to put together a repo

this seems to be an issue with vite's hmr implementation itself than this plugin, so i'm closing this for now ^^

Sure no problem, just wanted to let you know