-
-
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
Yarn local workspaces no longer working - fails on Preparing native dependencies #3597
Comments
@joezappie hey I saw your issue but I have been travelling and haven't been able to test this out. I can say I do have it working with Let me know if you've solved the issue already though! |
@joezappie I actually misspoke in my last post, I forgot we refactored our app in a way that we don't actually cross-reference Yarn workspaces anymore in our app which is why I haven't seen the issue. Regardless I was curious and wanted to dive into the issue a little deeper. It seemed to be failing on the # Basic debugging output
DEBUG=1 yarn workspace electron-app run package
# electron-packager debugging output (this gave me more info once I narrowed it down to electron-packager)
DEBUG=electron-packager yarn workspace electron-app run package Running either of those gave me a better error message:
I have run into weird permission errors on Windows before so I hopped over to my MacBook Pro and I confirmed that the command is working as expected on Mac. So, I hopped back to my PC and was trying a bunch of different things to no avail. I finally ended up trying to run Git Bash as administrator and got it to work. I'm not sure exactly what change in Just for your SA, the other things I tried on Windows that didn't end up working were messing with Yarn's I hope this helps and let me know if launching your terminal with administrator privileges works and if that's a viable solution for you. |
I'm having a very similar issue, but I'm on an ARM Mac. We're using An unhandled rejection has occurred inside Forge:
Error: ENOENT: no such file or directory, stat '/private/var/folders/pr/SOME_RANDOM_VALUE/T/electron-packager/tmp-ANOTHER_RANDOM_VALUE/Electron.app/Contents/Resources/app/node_modules/MY_WORKSPACE_MODULE' The file specified by the above path is a symlink, and it resolves to a relative path from the root of the electron app's workspace. Since the dependency was copied into this temporary directory for packaging, the relative path is no longer valid and the symlink doesn't resolve. Is there something I'm missing here? I've been banging my head against this for ages. I would've expected the packager to copy the actual resolved directory to the temp directory, not the symlink. |
Pre-flight checklist
Electron Forge version
7.4.0
Electron version
30.0.3
Operating system
Windows 10
Last known working Electron Forge version
7.2.0
Expected behavior
I had an issue #3388 about using yarn workspaces for a monorepo where the my electron app depends on other local workspace packages. At the time 7.2.0 was out and @easternmotors was able to show me how to configure yarn to get it to build using the
workspaces:
protocol.Upgrading that test repo to 7.4.0, it now crashes on the "Preparing native dependencies" step.
I'm new to yarn but it doesn't appear to output any error on the crash. Running
make
with npm instead crashes on the same step and provides an unhelp generic error:This test repo is just an electron app created with the command
yarn create electron-app electron-app --template vite
and a local workspace test package added to its dependencies, so very easy to repeat.Actual behavior
It should build when a local workspace is used as a dependency
Steps to reproduce
I have two repo to simulate it was working on 7.2 and failing on 7.4:
7.4.0 Fail Test Repo
https://github.com/joezappie/yarn-electron-workspaces/tree/bug/electron-forge-make
Preparing native dependencies
step7.2.0 Success Test Repo
https://github.com/joezappie/yarn-electron-workspaces
Additional information
I tried 7.3.0/7.3.1 but I run into an an error saying
electron-forge/plugin-vite
needed to be in my dev dependencies, despite being in it so I gave up on those versions. Not sure if its 7.3 or 7.4 that broke the module resolution of local workspaces dependencies.Is there now a different way of needing to do this?
The text was updated successfully, but these errors were encountered: