-
-
Notifications
You must be signed in to change notification settings - Fork 505
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-forge does not work with yarn workspaces #869
Comments
Can you try Electron Forge v6? (That version is more likely to get a fix for this.) |
Yeah, that's probably not going to work either. Yarn workspaces function differently than lerna (and bolt, which Forge uses) in that there's only one |
This doesn't work either as you pointed out already.
I don't know about bolt, but lerna supports yarn workspaces so that could create the same issue once one tries to enable them.
yarn.lock is generated in each yarn workspace folder. |
I ran
That's not what I'm seeing in my tests. Yarn: 1.16.0, Linux |
Alright that was my mistake, shame on me. I left the lock file after migration to a monorepo.
That's great to hear! Let me know if I can help in these tasks. |
So I have a fix for this particular issue, but I can guarantee that this will not work out-of-the-box once you get to the |
Had the same problem. Fixed this by moving |
Thanks for the suggestion! |
symlinking the node_modules folder worked for me Not sure about the build and everything through |
This was fixed in Electron Forge v6. |
Mmmh, I am using It bugged with my simple symlink in the end, I used @alxmiron 's solution with noihoist. It is working well
|
Is this yarn 1 or 2? |
I am using the |
I can make a reproduction repository if it is useful for you |
It would be helpful to have a minimal testcase, yes. |
I was using typescript-webpack template, my bad. Here is a reproduction repository: |
Feel free to tell me if you need any other information |
I ended up adding
I tried to add express package and I get a lot of problems with the workspaces |
@abumalick has correct testcase - I also get an error
NOTE: |
Using "nohoist" is more of a workaround than a real solution. 🙁 |
Yeah using nohoist isn't viable in monorepos that contain more than one app. what ends up happening is the install time ballons, the diskspace taken ballons. The only long term viable solution is to change whatever logic it is that makes assumptions about where the electron package is. i mean... just use the normal node resolver. This is a huge problem in react-native too. |
Thanks for the hints about In the latest version of Yarn Berry (2.4.1?), In our case, this meant removing nmHoistingLimits: workspaces Note that that line goes in After this, everything worked 🙂 |
It looks like this has been fixed in the latest version ( |
can we have electron forget without nohoist? |
"workspaces": {
"packages": [
"apps/*",
"packages/ts/*"
],
"nohoist": [
"**/electron"
]
}, yarn --version
1.22.22 Hopefully save someone a minute running around, |
Since I use Yarn workspaces electron-forge complains about missing dependencies which are installed through yarn in parent folder. My directory structure is as following:
Console Output (with stack)
What command line arguments are you passing?
none.
What does your
config.forge
data inpackage.json
look like?config.forge settings
To recreate this issue simply create a new project with electron-forge and then wrap it into a yarn workspace. to do this you refer to this guide: https://yarnpkg.com/en/docs/workspaces
You could also recreate my directory structure and use the following root package.json contents:
The text was updated successfully, but these errors were encountered: