Skip to content

"dependency path is undefined" errors after upgrade to electron-builder 26 #9011

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

Closed
panther7 opened this issue Apr 4, 2025 · 4 comments · Fixed by #9013
Closed

"dependency path is undefined" errors after upgrade to electron-builder 26 #9011

panther7 opened this issue Apr 4, 2025 · 4 comments · Fixed by #9013

Comments

@panther7
Copy link
Contributor

panther7 commented Apr 4, 2025

We have similar issue like #9006 with dependency path is undefined, becase project has node_modules in root folder, but "build" folder is without node_modules.
Posible solution is define path for node_modules, like this https://www.electron.build/app-builder-lib.interface.metadatadirectories

Example:

.
├── node_modules
└── dist
    └── app.html

Works perfectly in electron-builder 25.

Testcases:

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 4, 2025

@panther7 would you be willing to share a minimum repro repo for us to create a unit test from?

@beyondkmp can you please take a look at this?

@panther7
Copy link
Contributor Author

panther7 commented Apr 4, 2025

@mmaietta simple test case added to first desc.

@panther7
Copy link
Contributor Author

panther7 commented Apr 4, 2025

Actually is our hotfix via yarn patch:

diff --git a/out/node-module-collector/nodeModulesCollector.js b/out/node-module-collector/nodeModulesCollector.js
index 1e9256cd6d6809262250452cc1c6a708e4d53124..69729da9faebf31bdc77452003895299d53d3379 100644
--- a/out/node-module-collector/nodeModulesCollector.js
+++ b/out/node-module-collector/nodeModulesCollector.js
@@ -26,6 +26,7 @@ class NodeModulesCollector {
     async getDependenciesTree() {
         const command = await this.pmCommand.value;
         const args = this.getArgs();
+        args.push("--prefix", "../");
         const dependencies = await (0, builder_util_1.exec)(command, args, {
             cwd: this.rootDir,
             shell: true,

@beyondkmp
Copy link
Collaborator

Released v26.0.13

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

Successfully merging a pull request may close this issue.

3 participants