You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, I'm trying to get an electron+zeromq+p?react+vite working.
I switched over to vite after running into a blocker with webpack..
Strangely enough, now vite is dying exactly the same way.
I.e. adding zeromq as an external dependecy gets the app to load (this is also required in webpack for the app to run), but the built app (i.e. the result of npm run build) dies with this:
\D5280:x86_64-Linux5:~/gui/vite-bug/ZMQTest>./release/0.0.0/YourAppName-Linux-0.0.0.AppImage
A JavaScript error occurred in the main process
Uncaught Exception:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'zeromq' imported from /tmp/.mount_YourApYAxnh0/resources/app.asar/dist-electron/main.js
at packageResolve (node:internal/modules/esm/resolve:861:9)
at moduleResolve (node:internal/modules/esm/resolve:934:18)
at defaultResolve (node:internal/modules/esm/resolve:1176:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36)
D5280:x86_64-Linux5:~/gui/vite-bug/ZMQTest>
D5280:x86_64-Linux5:~/gui/vite-bug/ZMQTest>gdif
diff --git a/ZMQTest/vite.config.ts b/ZMQTest/vite.config.ts
index ece5fc3..4f6d60e 100644
--- a/ZMQTest/vite.config.ts
+++ b/ZMQTest/vite.config.ts
@@ -11,6 +11,14 @@ export default defineConfig({
main: {
// Shortcut of `build.lib.entry`.
entry: 'electron/main.ts',
+ vite: {
+ build: {
+ rollupOptions: {
+ external: ['zeromq',
+ 'electron-settings'] // 👈👈
+ },
+ },
+ },
},
preload: {
// Shortcut of `build.rollupOptions.input`.
D5280:x86_64-Linux5:~/gui/vite-bug/ZMQTest>
This is a blocker that I don't yet know how to solve. Can a kind soul please help?
The text was updated successfully, but these errors were encountered:
Please see vitejs/vite#19128
The minimal repo is in https://github.com/devzzzero/vite-zeromq-bug
Basically, I'm trying to get an electron+zeromq+p?react+vite working.
I switched over to vite after running into a blocker with webpack..
Strangely enough, now vite is dying exactly the same way.
I.e. adding zeromq as an external dependecy gets the app to load (this is also required in webpack for the app to run), but the built app (i.e. the result of
npm run build
) dies with this:This is a blocker that I don't yet know how to solve. Can a kind soul please help?
The text was updated successfully, but these errors were encountered: