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

electron-builder does not bundle the dependencies correctly in the build #7702

Closed
nikitavoloboev opened this issue Jul 30, 2023 · 7 comments
Closed
Labels

Comments

@nikitavoloboev
Copy link

nikitavoloboev commented Jul 30, 2023

  • Electron-Builder Version: 24.4.0
  • Node Version: 18.15.0

Trying to do build of app here:

https://github.com/learn-anything/electron-version

If git clone and cd app and pnpm run compile which runs:

electron-builder build --config .electron-builder.config.js --dir --config.asar=false

.electron-builder.config.js is config file.

image

It compiles

But when I try open the app from dist I see this:

image

I am not sure why but it seems that electron-builder is not bundling the node dependencies correctly for the build?

Thank you lots for any help.

@nikitavoloboev
Copy link
Author

From my investigations I found this issue:

TryGhost/node-sqlite3#909

Which had this comment

image

trying to add https://github.com/electron/rebuild now

hopefully that fixes it

@nikitavoloboev
Copy link
Author

nikitavoloboev commented Jul 30, 2023

It's unclear how to actually integrate rebuild package into the process.

I understand I have to somehow modify the dependency call to node-sqlite3 with rebuild but how is super unclear even after reading rebuild docs.

@Iku-turso
Copy link

This problem is likely caused by pnpm's isolated hoisting being strictly incompatible with electron-builder. This is realised in #6289 and here.

The current unfortunate kludge seems to be to throw all that pnpm goodness out of the window, and use something like pnpm install --shamefully-hoist.

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 11, 2023
Copy link
Contributor

This issue was closed because it has been stalled for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2023
@AiHaibara
Copy link

for electron-builder 25 or 25.0.4
when i using pnpm and
shamefully-hoist=true in npmrc
sometimes the builded exe, it will show the error cannot find module 'jsonfile/utils'...
but using node-linker=hoisted in npmrc is ok
and in 24.13.3 shamefully-hoist=true is working.

@hifron
Copy link

hifron commented Sep 24, 2024

I would expect something like post:install script, plugin or addon to build process. Maybe in pnpm or electron which not copy but maybe some additional work if required and not fully expose all the shit.

there even could be option when building with exposing variables which setup this option or tell pnpm to post:install situation is required without manual intervention due electron build.

Seem as pnpm(and its store) uses modified esbuild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants