Open giladgd opened 1 week ago
Can you try to repro on next
25.1.4? There were some updates from an upstream dependency that were merged in.
I forgot to mention it but I already tried, and the issue is still there.
Looking at the linked issue, you mentioned that it doesn't occur in 25.0.0, but does in 25.0.1. This may be the offending PR then since it's related to the module dependency tree resolution changes in upstream dependency app-builder-bin https://github.com/electron-userland/electron-builder/pull/8353/files
@beyondkmp can you take a look at this when you have a chance since it looks to be related to app-builder?
I have also those issues. Tried also to use 25.1.4 but starting from 25.x my app isn't working anymore after electron build process.
We get the same issue after upgrading to 25.x from 24.x in our CI pipeline. Weirdly only on macOS/Linux builds so far, and mostly different dependencies, varies from build to build.
@giladgd I have confirmed that this MR(https://github.com/develar/app-builder/pull/138) can fix this issue.
i had a somewhat similar issue here i think ...has similar 'wrong version of dependency' used/installed in deep node_modules folder with multiple versions of things.... https://github.com/electron-userland/electron-builder/issues/8503
my question is how is the node_modules folder being constructed, is it much different than before and why the change?
the "varies from build to build" is quite strange also!
@giladgd deploying release v25.1.6 now. Please update when you have a chance
25.0.5
22.8.0
10.8.0
32.1.0
current
macOS arm64
There's an issue with the latest
electron-builder
where after packaging an app, thenode_modules
directory will include wrong module versions for sub-modules.I'll explain better with a reproducible example:
cd electron-builder-issue
package.json
and remove thepostinstall
script to skip the model downloadnpm install
npm run build
release/mac-arm64
directory) and see that it workspackage.json
. UnderdevDependencies
, change theelectron-builder
version to25.0.5
npm install
npm run build
require() of ES Module
, sometimes it's about a missing import, it's pretty random from my testings. Locate from the long error which module is "the importer" (the one trying to import another module), and which module is "the imported" (the module that was attempted to be imported).This is the error I received when trying to open the app:
In my error: "The importer" is:
string-width/node_modules/strip-ansi
"The imported" is:ansi-regex
The above error happened because some of the code was trying to load some version of a module but instead received a completely different version of it.
Here's how you can validate that this is indeed the issue:
cd release/mac-arm64/node-llama-cpp-electron-example.app/Contents/Resources/
npx asar e app.asar app.content
cat ./app.content/node_modules/ansi-regex/package.json
and see that the version of the bundledansi-regex
is6.1.0
cat ./app.content/node_modules/string-width/node_modules/strip-ansi/package.json
and see this in thepackage.json
ofstrip-ansi
:As you can see,
strip-ansi
expected a^5.0.1
version ofansi-regex
, but actually received6.1.0
, which is incompatible.From my testings, this issue doesn't happen with
electron-builder
version25.0.0
, but does happen with25.0.1
.Because of this issue, I downgraded the version of
electron-builder
in thenode-llama-cpp
Electron template for now until this is resolved.