-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
Building app does not work with yarn workspaces that depend on each other #3388
Comments
@jrj2211 I have a similar setup, have you figured out a workaround? If you haven't, I would try using the
using
Let me know if you are still having issues. |
I ended up coming up with a very complicated I apologize, I do not follow what you're suggesting here as an alternatives. Is that a keyword that can be added in the package.json dependencys? My root package.json defines my workspaces:
I then have the following folders:
My
I don't use the
|
Okay, I just tried this and still not having any luck. Heres a minimal github repository.
If I run If i run
I added
So TLDR:
I cant find a way to satisfy both. Any help is appriciated. |
@jrj2211 Thanks for the minimal repo! That definitely helps. I forked your repo and made an MR explaining what I changed and why I changed it. I can run the repo on my machine now and Hope this helps and let me know if you run into any issues with that setup. I Typescript-ify and ESM-ify everything I can so the minimal changes might have a bit of that flavor still baked in. |
Awesome! Just checked it out and I am able to build and run it as well. I can't thank you enough for taking the time to pull my repo, make changes, and then even write explanations for why you changed what you did!! Incredible. Closing this issue as resolved. |
@jrj2211 No problem! I've done my fair share of struggling to get Electron Forge working with my project so happy to help. I actually use the Webpack plugin so it was cool seeing how the Vite plugin worked. |
If you're considering switching over, I'd highly recommend it. I used to do all my projects in Webpack but man Vite just requires almost no config to get things working so I was watching the issue for months and was on it they day they released it. I don't miss all the webpack plugins I'd have to install to get things to build properly. Electron also recently introduced ESM support, so now time to struggle through fully removing any trace of CJS in my projects! |
Pre-flight checklist
Electron Forge version
6.4.2
Electron version
27.0.2
Operating system
Windows 10 22H2
Last known working Electron Forge version
N/A
Expected behavior
Building apps in a yarn workspace should properly resolve dependencies
Actual behavior
Dependencies are missing
Steps to reproduce
yarn init
yarn create electron-app packages/my-app
yarn workspace my-app make
See that it errors out due to a missing dependency such as electron-squirrel-startup.
nohoist: "**"
yarn workspace my-app make
See that it errors out due to symbolic links
Additional information
I enabled nohoist in my project to get around the dependency issue as described in #1377.
Since I'm trying to use another local workspace module in my electron app, thats linked as a symbolic link in node_modules. Electron forge/builder doesn't recognize that it should follow the symbolic link and include that, and instead errors out.
I have no clue at this point how to get this all working. One of the discussions included using an
afterCopy
hook to runyarn install --production
. I believe this would fix not having to use nohoist, but I don't think it would fix the issue of using local workspaces that are symbolically linked together? I've been unable to figure out a hook that works for me.The text was updated successfully, but these errors were encountered: