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

An error is reported after vue is imported #3548

Open
3 tasks done
188 opened this issue Mar 24, 2024 · 8 comments
Open
3 tasks done

An error is reported after vue is imported #3548

188 opened this issue Mar 24, 2024 · 8 comments

Comments

@188
Copy link

188 commented Mar 24, 2024

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.3.1

Electron version

29.1.5

Operating system

macOS 14.3.1

Last known working Electron Forge version

No response

Expected behavior

yarn make can run properly with no error reported:

Actual behavior

yarn run v1.22.19
$ electron-forge package
✔ Checking your system
⠙ Preparing to package application
◼ Running packaging hooks
✔ Preparing to package application
❯ Running packaging hooks
✔ Running generateAssets hook
✔ Preparing to package application
❯ Running packaging hooks
✔ Running generateAssets hook
❯ Running prePackage hook
⠸ [plugin-vite] Building vite bundles
◼ Packaging application
◼ Running postPackage hook
✔ Preparing to package application
✔ Preparing to package application
❯ Running packaging hooks
✔ Running generateAssets hook
❯ Running prePackage hook
✔ Preparing to package application
✔ Running packaging hooks
✔ Running generateAssets hook
✔ Running prePackage hook
✔ [plugin-vite] Building vite bundles
❯ Packaging application
❯ Packaging for arm64 on darwin
✔ Copying files
✔ Preparing native dependencies [0.5s]
✖ Finalizing package
› /var/folders/f3/_c8y2b7575gb8zwp0k3fy4cc0000gn/T/electron-packager/tmp-LAvMjM/Electron.app/Contents/Resources/a…
◼ Running postPackage hook

An unhandled rejection has occurred inside Forge:
Error: /var/folders/f3/_c8y2b7575gb8zwp0k3fy4cc0000gn/T/electron-packager/tmp-LAvMjM/Electron.app/Contents/Resources/app/node_modules/@vue/compiler-core/node_modules/.bin/parser: file "../../../../../../../../../../../../var/folders/f3/_c8y2b7575gb8zwp0k3fy4cc0000gn/T/electron-packager/tmp-LAvMjM/Electron.app/Contents/Resources/app/node_modules/@babel/parser/bin/babel-parser.js" links out of the package
at Filesystem.insertLink (/Users/steven/data/test/my-new-app21/node_modules/@electron/asar/lib/filesystem.js:106:13)
at handleFile (/Users/steven/data/test/my-new-app21/node_modules/@electron/asar/lib/asar.js:132:20)
at next (/Users/steven/data/test/my-new-app21/node_modules/@electron/asar/lib/asar.js:148:11)
at next (/Users/steven/data/test/my-new-app21/node_modules/@electron/asar/lib/asar.js:149:12)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MacApp.asarApp (/Users/steven/data/test/my-new-app21/node_modules/@electron/packager/src/platform.ts:245:5)
at async MacApp.buildApp (/Users/steven/data/test/my-new-app21/node_modules/@electron/packager/src/platform.ts:150:5)
at async MacApp.initialize (/Users/steven/data/test/my-new-app21/node_modules/@electron/packager/src/platform.ts:141:7)
at async MacApp.create (/Users/steven/data/test/my-new-app21/node_modules/@electron/packager/src/mac.ts:435:5)
at async Promise.all (index 0)
at async packager (/Users/steven/data/test/my-new-app21/node_modules/@electron/packager/src/packager.ts:246:20)
error Command failed with exit code 1.

Steps to reproduce

1、npm init electron-app@latest my-vue-app -- --template=vite
2、npm install vue
3、npm install --save-dev @vitejs/plugin-vue
4、yarn
5、yarn make

Additional information

No response

@dietrich-stein
Copy link

dietrich-stein commented Mar 24, 2024

I seem to be seeing a related issue running electron-forge package --platform darwin while building on macOs.

An unhandled rejection has occurred inside Forge:
Error: /var/folders/wl/pm6gbjcn1gl79xh6vjznq7k80000gn/T/electron-packager/tmp-NNy4Lz/Electron.app/Contents/Resources/app/node_modules/@babel/helper-compilation-targets/node_modules/.bin/semver: file "../../../../../../../../../../../../var/folders/wl/pm6gbjcn1gl79xh6vjznq7k80000gn/T/electron-packager/tmp-NNy4Lz/Electron.app/Contents/Resources/app/node_modules/@babel/helper-compilation-targets/node_modules/semver/bin/semver.js" links out of the package
at Filesystem.insertLink (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/asar/lib/filesystem.js:106:13)
at handleFile (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/asar/lib/asar.js:132:20)
at next (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/asar/lib/asar.js:148:11)
at next (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/asar/lib/asar.js:149:12)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MacApp.asarApp (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/packager/src/platform.ts:245:5)
at async MacApp.buildApp (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/packager/src/platform.ts:150:5)
at async MacApp.initialize (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/packager/src/platform.ts:141:7)
at async MacApp.create (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/packager/src/mac.ts:435:5)
at async Promise.all (index 0)
at async packager (/Users/dietrichstein/deepmojo-electron-vite/node_modules/@electron/packager/src/packager.ts:246:20)

Presumably, this could be reproducible on LuanRoger/electron-shadcn but I have not tried.

I tried several things including (1) a packageAfterPrune() hook trying to delete the file assuming it is being left behind due to a versioning mismatch (2) derefSymlinks: false, (3) vite-plugin-commonjs-externals, (4) optimizeDeps.exclude, (5) externalizeDepsPlugin from electron-vite. No combination of workaround using any them were fruitful for me. Currently looking at what electron-vite really has to offer as an alternative.

Edit: Reproduced the OP report using the steps provided:

An unhandled rejection has occurred inside Forge:
Error: /var/folders/wl/pm6gbjcn1gl79xh6vjznq7k80000gn/T/electron-packager/tmp-S2cbBg/Electron.app/Contents/Resources/app/node_modules/@vue/compiler-core/node_modules/.bin/parser: file "../../../../../../../../../../../../var/folders/wl/pm6gbjcn1gl79xh6vjznq7k80000gn/T/electron-packager/tmp-S2cbBg/Electron.app/Contents/Resources/app/node_modules/@babel/parser/bin/babel-parser.js" links out of the package
at Filesystem.insertLink

@188
Copy link
Author

188 commented Mar 25, 2024

Is there a solution?
Now how to operate can make or package normally.
Or do you need to wait for a new release? Maybe downgrade to 7.3.0?

@Nick22nd
Copy link

Nick22nd commented Mar 31, 2024

I encountered the same issue(links out of the package), and I resolved it by removing yarn.lock and node_modules. Switch to npm:

rm -rf node_modules yarn.lock
npm i

@tclxsr
Copy link

tclxsr commented Apr 2, 2024

I encountered the same issue(links out of the package), and I resolved it by removing yarn.lock and node_modules. Switch to npm:

rm -rf node_modules yarn.lock
npm i

Its worked for me!

@188
Copy link
Author

188 commented Apr 16, 2024

After many tests, the problem was found, as long as the vue was introduced and then packaged, the error was reported, and there was no problem when the vue was removed. Is there any feasible solution?

@188
Copy link
Author

188 commented Apr 16, 2024

https://www.electronforge.io/guides/framework-integration/vue-3#integrating-vue-3-code
Follow the document
An error occurs after npm install vue.
No problem after npm uninstall vue

@188
Copy link
Author

188 commented Apr 19, 2024

God can help with that. Thank you

@188
Copy link
Author

188 commented Apr 19, 2024

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

4 participants