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

Failed to build when --watch is enabled #1

Closed
hectorob91 opened this issue Oct 27, 2022 · 9 comments
Closed

Failed to build when --watch is enabled #1

hectorob91 opened this issue Oct 27, 2022 · 9 comments

Comments

@hectorob91
Copy link

I'm trying to use vite build --watch and everytime I got the following error.

Error: [@brillout/vite-plugin-import-build][Bug] You stumbled upon a bug in the source code of @brillout/vite-plugin-import-build. Reach out at https://github.com/brillout/vite-plugin-import-build/issues/new and include this error stack (the error stack is usually enough to fix the problem). (Debug info for the maintainers: {"distImporterDir":"/react-node-ssr/dist/server","distImporterPathRelative":"/react-node-ssr/dist/server/importBuild.cjs"})
at assert (/react-node-ssr/node_modules/@brillout/vite-plugin-import-build/dist/utils/assert.js:10:11)
at loadWithNodejs (/react-node-ssr/node_modules/@brillout/vite-plugin-import-build/dist/loadBuild/index.js:49:32)
at loadBuild (/react-node-ssr/node_modules/@brillout/vite-plugin-import-build/dist/loadBuild/index.js:23:51)
at loadBuild (/react-node-ssr/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/importBuild/loadBuild.js:15:72)
at getGlobalContext (/react-node-ssr/node_modules/vite-plugin-ssr/dist/cjs/node/globalContext.js:29:62)
at prerender (/react-node-ssr/node_modules/vite-plugin-ssr/dist/cjs/node/prerender.js:42:70)
at async triggerFullBuild (/react-node-ssr/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/autoFullBuild.js:57:9)
at async Object.writeBundle (/react-node-ssr/node_modules/vite-plugin-ssr/dist/cjs/node/plugin/plugins/autoFullBuild.js:23:17)
at async Promise.all (index 0)
at async PluginDriver.hookParallel (file:///react-node-ssr/node_modules/rollup/dist/es/shared/rollup.js:22638:9)
at async file:///react-node-ssr/node_modules/rollup/dist/es/shared/rollup.js:23763:13
at async catchUnfinishedHookActions (file:///react-node-ssr/node_modules/rollup/dist/es/shared/rollup.js:23088:20)
at async Promise.all (index 0)
at async Task.run (file:///react-node-ssr/node_modules/rollup/dist/es/shared/watch.js:4944:32)
at async Watcher.run (file:///react-node-ssr/node_modules/rollup/dist/es/shared/watch.js:4871:13)

@brillout
Copy link
Owner

$ vite build --watch Why do you want to do this? Why not $ vite dev instead?

@hectorob91
Copy link
Author

Let me try with that command.

@brillout
Copy link
Owner

👍

Let me close in the meantime because I don't think --watch makes sense in the context of SSR.

@eternaleye
Copy link

So, this makes sense in the context of my use case because I'm using CloudFlare Pages with workers, and so I want to be using wrangler pages dev --live-reload, which means it needs to see HTML updating on-disk, which means I need to be running vite build --dev. Could this get fixed?

@brillout
Copy link
Owner

brillout commented Nov 8, 2023

@eternaleye Makes sense, good to know. It's likely to be fixed once vikejs/vike#562 is implemented.

@eternaleye
Copy link

Thank you!

@brillout
Copy link
Owner

brillout commented Nov 8, 2023

(Btw. in case your company is up for it: https://github.com/sponsors/brillout.)

@DebasishWe
Copy link

@brillout Vite build watch is necessary when include that html in template like cdn. Can u please provide the solution.

@brillout
Copy link
Owner

@DebasishWe Adding support for --watch isn't a priority for the moment. But feel free to elaborate your use case and explain whether/why you absolutely need this.

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

4 participants