Closed Verequies closed 4 months ago
After getting the build to work and packaging it. I receive the following error (debug output enabled:
MODULE 227532: load built-in module electron/js2c/browser_init
MODULE 227532: looking for "/opt/nvm-desktop/resources/app.asar/package.json" in []
MODULE 227532: load "/opt/nvm-desktop/resources/app.asar/package.json" for module "/opt/nvm-desktop/resources/app.asar/package.json"
MODULE 227532: looking for "electron-updater" in ["/opt/nvm-desktop/resources/app.asar/dist/main/main.mjs/node_modules","/opt/nvm-desktop/resources/app.asar/dist/main/node_modules","/opt/nvm-desktop/resources/app.asar/dist/node_modules","/opt/nvm-desktop/resources/app.asar/node_modules","/opt/nvm-desktop/resources/node_modules"]
MODULE 227532: looking for "electron-log" in ["/opt/nvm-desktop/resources/app.asar/dist/main/main.mjs/node_modules","/opt/nvm-desktop/resources/app.asar/dist/main/node_modules","/opt/nvm-desktop/resources/app.asar/dist/node_modules","/opt/nvm-desktop/resources/app.asar/node_modules","/opt/nvm-desktop/resources/node_modules"]
MODULE 227532: looking for "got" in ["/opt/nvm-desktop/resources/app.asar/dist/main/main.mjs/node_modules","/opt/nvm-desktop/resources/app.asar/dist/main/node_modules","/opt/nvm-desktop/resources/app.asar/dist/node_modules","/opt/nvm-desktop/resources/app.asar/node_modules","/opt/nvm-desktop/resources/node_modules"]
MODULE 227532: looking for "tar-fs" in ["/opt/nvm-desktop/resources/app.asar/dist/main/main.mjs/node_modules","/opt/nvm-desktop/resources/app.asar/dist/main/node_modules","/opt/nvm-desktop/resources/app.asar/dist/node_modules","/opt/nvm-desktop/resources/app.asar/node_modules","/opt/nvm-desktop/resources/node_modules"]
MODULE 227532: looking for "compressing" in ["/opt/nvm-desktop/resources/app.asar/dist/main/main.mjs/node_modules","/opt/nvm-desktop/resources/app.asar/dist/main/node_modules","/opt/nvm-desktop/resources/app.asar/dist/node_modules","/opt/nvm-desktop/resources/app.asar/node_modules","/opt/nvm-desktop/resources/node_modules"]
MODULE 227532: looking for "is-plain-obj" in ["/opt/nvm-desktop/resources/app.asar/dist/main/main.mjs/node_modules","/opt/nvm-desktop/resources/app.asar/dist/main/node_modules","/opt/nvm-desktop/resources/app.asar/dist/node_modules","/opt/nvm-desktop/resources/app.asar/node_modules","/opt/nvm-desktop/resources/node_modules"]
MODULE 227532: load built-in module node:url
MODULE 227532: load built-in module node:fs
MODULE 227532: load built-in module node:constants
MODULE 227532: load built-in module node:stream
MODULE 227532: load built-in module node:util
MODULE 227532: load built-in module node:assert
MODULE 227532: load built-in module node:os
MODULE 227532: load built-in module node:crypto
MODULE 227532: load built-in module node:events
MODULE 227532: load built-in module node:path
MODULE 227532: load built-in module node:process
MODULE 227532: load built-in module node:stream/consumers
MODULE 227532: load built-in module node:fs/promises
MODULE 227532: load built-in module node:stream/promises
MODULE 227532: load built-in module node:zlib
MODULE 227532: load built-in module node:child_process
MODULE 227532: load built-in module node:module
A JavaScript error occurred in the main process
Uncaught Exception:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'electron-updater' imported from /opt/nvm-desktop/resources/app.asar/dist/main/main.mjs
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:892:9)
at moduleResolve (node:internal/modules/esm/resolve:941:20)
at defaultResolve (node:internal/modules/esm/resolve:1134:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36)
Thus far I have not been able to figure out what is causing it. It does work when running from 'releases/build/linux-unpacked/nvm-desktop' but not from the installed/packaged directory.
Hello,
I have just tried building this project, unfortunately I am met with an error:
error during build: Error: [vite]: Rollup failed to resolve import "intro.js" from "/home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/intro.js-react/dist/esm/components/Steps/index.mjs". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to `build.rollupOptions.external` at viteWarn (file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/vite/dist/node/chunks/dep-nGG-_oRu.js:67037:27) at onwarn (file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/@vitejs/plugin-react/dist/index.mjs:250:9) at onRollupWarning (file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/vite/dist/node/chunks/dep-nGG-_oRu.js:67062:9) at onwarn (file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/vite/dist/node/chunks/dep-nGG-_oRu.js:66776:13) at file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/rollup/dist/es/shared/node-entry.js:17420:13 at Object.logger [as onLog] (file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/rollup/dist/es/shared/node-entry.js:19078:9) at ModuleLoader.handleInvalidResolvedId (file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/rollup/dist/es/shared/node-entry.js:18024:26) at file:///home/AUR/nvm-desktop/src/nvm-desktop.git/node_modules/rollup/dist/es/shared/node-entry.js:17982:26
This can be fixed by adding 'intro.js' to the package.json. After running 'yarn add intro.js' the build was successful.
Have you tried building using pnpm
, maybe you can try it. I checked the intro.js-react
package and it does require intro.js
as a pre-dependency. It's unclear to me if this is due to differences between yarn
and pnpm
. But thank you very much for pointing this out. 🌹
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'electron-updater' imported from /opt/nvm-desktop/resources/app.asar/dist/main/main.mjs
I'm not sure if your code is up to date. You can check the electron.vite.config.ts
file and do not enable externalizeDepsPlugin
under the main
option.
main: {
resolve: {
alias: {
"@src": resolve("src")
}
},
build: {
rollupOptions: {
input: isTest ? "src/main/main.test.ts" : "src/main/main.ts",
output: {
entryFileNames: "main.mjs",
inlineDynamicImports: true,
format: "es"
}
}
},
plugins: [del({ targets: ["release/app/dist", "release/build"] })] // this line
},
And did you build it using the Linux
platform? Currently, I don't have a Linux device. Some problems may not be discovered and solved in time, and you may need to provide some additional information.
Thanks for your reply :)
I tried both pnpm
and yarn
but neither worked until I added intro.js
. There were some references online saying to try this, and it indeed fixed that error.
With the runtime error, it seems I may have solved it by using the latest git commit rather than the 3.0.0 tag.
However I did have to remove the unused useRef
as below:
src/renderer/src/pages/home/setting.tsx:1:16 - error TS6133: 'useRef' is declared but its value is never read.
1 import { memo, useRef, useState } from "react";
Thank you for your feedback. Anyway I will add intro.js
to dependencies to avoid this error.
src/renderer/src/pages/home/setting.tsx:1:16 - error TS6133: 'useRef' is declared but its value is never read.
Yes it was a ts
type checking error, I fixed it locally. However, due to some additional work(use esbuild
instead of rollup
to compile), the code has not been submitted yet, please understand.
No worries, I understand :) App works pretty well so far now that it is building and running!
The latest code from the current main
branch should work fine.
Then I will close this issue first. Of course, if you have any questions later, you can reopen it at any time. Thanks.
Hello,
I have just tried building this project, unfortunately I am met with an error:
This can be fixed by adding 'intro.js' to the package.json. After running 'yarn add intro.js' the build was successful.