question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

electron-builder not including entire dependency in built version

See original GitHub issue
  • Electron-Builder Version: 22.14.5
  • Node Version: v17.4.0
  • Electron Version: 16.0.1
  • Electron Type (current, beta, nightly): current
  • Target: Window and MacOS

I am attempting to package my application using electron-builder, but one of my dependencies is not getting the entire module in the built version. Here is what the dependency looks like in my node_modules folder that is not built: image

And here is what it looks like when I extract the app.asar file: image

As you can see it is missing the constructor folder entirely. I have tried including the specific files in the build path but I simply cannot get this to work. I’ve tried everything from re-installing my packages, updating node version, importing the index.js file directly, adding every variation of the file path to the build section of package.json. I would great appreciate some help on this. If you’d like even more info I even made a stackoverflow question:

https://stackoverflow.com/questions/70901907/electron-builder-not-including-entire-dependency-in-built-version

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
mmaiettacommented, Feb 7, 2022

Maybe you can use patch-package to rename the folder and imports? Or manually include. You might be able to use asarUnpack to include everything else in an asar and then have @truffle only unpacked (like how a .node file would normally be)

asarUnpack Array<String> | String | “undefined” - A glob patterns relative to the app directory, which specifies which files to unpack when creating the asar archive.

1reaction
Irantwomilescommented, Feb 6, 2022

Please provide minimum repro repo and I can try and take a look at this edge case

I will later today once I get home.

Read more comments on GitHub >

github_iconTop Results From Across the Web

electron-builder not including entire dependency in built version
My issue is that in the built version of the program, the entire constructor folder is missing. The way I look at the...
Read more >
Common Configuration - electron-builder
If buildVersion is not defined and buildNumber (or one of the buildNumber envs) is defined, it will be used as a build version...
Read more >
Dependencies are not packaged by electron-builder ... - GitHub
I'm having issues trying to use pnpm and electron-builder. I tried multiple times to package the app using basic commands and build ......
Read more >
Packaging and distributing Electron applications using ...
Once these build artifacts are produced by electron-builder ... sets the dependencies as externals so they are never included in the output ...
Read more >
electron-packager - npm
Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI. Latest version: 17.1.1, last published: 2 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found