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

After migrating to a turborepo project, an error occurs after the application is installed and launched,but it's basically fine in development mode. #665

Open
4 tasks done
picasuo opened this issue Nov 20, 2024 · 3 comments

Comments

@picasuo
Copy link

picasuo commented Nov 20, 2024

Describe the bug

The relevant configuration before the project was migrated:

  • electron.vite.config.ts
image
  • electron-builder.yml
image
  • .npmrc
image

Some adjustments made after the project migration, and some related configurations in turborepo

image

Steps for reproducing the problem

  • copy the electron project directly to the turborepo project's apps/mindcraft-app ,name in package.json of electron project is medcraft-desktop-reborn.

  • use rm -rf node_modules in the turborepo root directory to remove all sub-project dependencies.then use pnpm install to install all project dependencies, including the electron project.

  • started electron app development mode using pnpm turbo run dev -filter=medcraft-desktop-reborn. everything works fine in development mode.

  • use pnpm turbo build:mac -filter=medcraft-desktop-reborn to build the installer, the build process reported no errors. When the installation is complete and the application is launched, an error popup appears, as shown below. The package hints for the error are electron-store, electron-updater. There is a strange phenomenon: the size of the app moved to /Applications has become significantly smaller, the previous one had more than 400MB, and now it's only more than 300MB.

image
  • based on the error message, I found the relevant answer 35.I took the advice and externalized some commonjs packages in the main module of elecron.vite.config.ts and then got the different error,as shown below. so I am particularly confused now. Is the problem I encountered related to the management method of pnpm workspace package? should I not adopt the answer to the above issue?
image

The post should have been posted in the discussion forum, but I see that the answers are not very positive over there, so all help is sought in the issue forum, so please forgive me.

Electron-Vite Version

2.0.0

Electron Version

28.2.0

Vite Version

5.0.12

Validations

@picasuo
Copy link
Author

picasuo commented Nov 20, 2024

如果会中文,可以用中文回答我。我也是机翻写的issue,懂中文的可以直接整页翻译阅读。

@hyusetiawan
Copy link

@picasuo did you find a solution? I am thinking of using electron-vite with turborepo as well

@picasuo
Copy link
Author

picasuo commented Dec 13, 2024

@picasuo did you find a solution? I am thinking of using electron-vite with turborepo as well
No, I think it's the way pnpm symbolically connects that causes problems with some of the older packages. Maybe you could try another package manager and see.Anyway, in the end I didn't migrate the electron project to the turbo repository, I added a web project directly to the electron-vite project.

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

No branches or pull requests

2 participants