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

[rush] I am using rush with an electron project. When I create a distributable app, there is an error of missing modules. #2670

Open
ahmadfaraz84 opened this issue May 2, 2021 · 4 comments

Comments

@ahmadfaraz84
Copy link

ahmadfaraz84 commented May 2, 2021

Summary

I am using a rush monorepo with pnpm as package manager. There is a project for electron app, which works well in development mode, but when I try to make a distributable package, there occurs an error for missing modules. For example in the below image, there is a missing dependency for "flatbuffers".
image

Now, if I copy that module manually into the project level node_modules, this error resolves but another occurs for another dependency. The problem is the symlinks for sub-dependencies of external packages are not created in project_level node_modules.
Plus @zkochan has commented (in the link) that "pnpm doesn't work with electron apps".

Repro steps

Expected result:

Actual result:

Details

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version?
rushVersion from rush.json?
useWorkspaces from rush.json?
Operating system?
Would you consider contributing a PR?
Node.js version (node -v)?
@iclanton
Copy link
Member

I'll admit I've never worked with an electron app, so I'm not familiar with the details of what their dependency requirements are. Did @zkochan give any information on what the underlying issues are?

@iclanton
Copy link
Member

Can you share a repro?

@ouyangxuxiang
Copy link

Is this bug solved?

@Iku-turso
Copy link

To OP: I suspect you are using electron-builder to build your distributable electron app. I also suspect you are using pnpm with isolated hoisting, being the default? That's incompatible with electron-builder, as it currently requires a flattened node_modules, instead of that thing pnpm does.

See here for more reasoning, context and a shameful workaround.

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

No branches or pull requests

4 participants