You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
6.4.0, 6.3.1 as well (older version did not test)
Electron version
29.3.0
Operating system
macOS 14.4.1 (tried on Windows, no issues, seems this is specific for macOS)
Last known working Electron Forge version
No response
Expected behavior
The package process should finish without an error and provide a successful macOS build.
Actual behavior
Below is the console output of the npm run package command that ends with an error without a successful build.
✗ npm run package
> electron-experiments-vite-ts@1.0.0 package
> electron-forge package
✔ Checking your system
✔ 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 [3s]
✖ Finalizing package
› /var/folders/cx/jfcxhpvd7pdb2q0bw3nzgwd40000gq/T/electron-packager/tmp-aRGLfT/Electron.app/Contents/Resources/app/node_modules/typeorm/node_modules/.bin/glob: file
"../../../../../../../../../../../../var/folders/cx/jfcxhpvd7pdb2q0bw3nzgwd40000gq/T/electron-packager/tmp-aRGLfT/Electron.app/Contents/Resources/app/node_modules/typeorm/node_modules/glob/dist/esm/bin.mjs"
links out of the package
◼ Running postPackage hook
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.vite v5.2.8 building for production...vite v5.2.8 building for production...vite v5.2.8 building for production...transforming (1) index.htmltransforming (1) src/preload.ts✓ 1 modules transformed.Generated an empty chunk: "preload".rendering chunks (1)...transforming (1) src/main.ts✓ 1 modules transformed.rendering chunks (1)...computing gzip size (0)...computing gzip size (1)....vite/build/preload.js 0.01 kB │ gzip: 0.03 kB✓ built in 38mscomputing gzip size (0)...computing gzip size (1)....vite/build/main.js 0.50 kB │ gzip: 0.32 kB✓ built in 39ms✓ 4 modules transformed.rendering chunks (1)...computing gzip size (0)...computing gzip size (1)...computing gzip size (2)...computing gzip size (3)....vite/renderer/main_window/index.html 0.37 kB │ gzip: 0.26 kB.vite/renderer/main_window/assets/index-CKttBNm8.css 0.14 kB │ gzip: 0.14 kB.vite/renderer/main_window/assets/index-D8Tcqwow.js 0.79 kB │ gzip: 0.46 kB✓ built in 46msAn unhandled rejection has occurred inside Forge:Error: /var/folders/cx/jfcxhpvd7pdb2q0bw3nzgwd40000gq/T/electron-packager/tmp-aRGLfT/Electron.app/Contents/Resources/app/node_modules/typeorm/node_modules/.bin/glob: file "../../../../../../../../../../../../var/folders/cx/jfcxhpvd7pdb2q0bw3nzgwd40000gq/T/electron-packager/tmp-aRGLfT/Electron.app/Contents/Resources/app/node_modules/typeorm/node_modules/glob/dist/esm/bin.mjs" links out of the packageat Filesystem.insertLink (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/asar/lib/filesystem.js:106:13) at handleFile (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/asar/lib/asar.js:132:20) at next (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/asar/lib/asar.js:148:11) at next (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/asar/lib/asar.js:149:12) at processTicksAndRejections (node:internal/process/task_queues:95:5) at async MacApp.asarApp (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/packager/src/platform.ts:245:5) at async MacApp.buildApp (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/packager/src/platform.ts:150:5) at async MacApp.initialize (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/packager/src/platform.ts:141:7) at async MacApp.create (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/packager/src/mac.ts:435:5) at async Promise.all (index 0) at async packager (/Users/ihor.levchenkoedisen.com/Projects/js/electron-experiments-vite-ts/node_modules/@electron/packager/src/packager.ts:246:20)
Steps to reproduce
I've been using NodeJS 20.9.0, NPM version is 10.1.0.
$ npm init electron-app@latest electron-experiments-vite-ts -- --template=vite-typescript
$ cd electron-experiments-vite-ts
$ npm i -S typeorm
$ npm run package
You will get an error posted in "Actual Behavior" section. I even have no idea why is it happening.
But once typeorm is removed (npm uninstall typeorm), now the build is successful. Kinda a "special" reaction on the typeorm.
Additional information
I did not specify the config files here, cos it is reproducible using a raw vite-typescript template without any modifications.
In fact, the files by those symlinks exist:
Probably the issue is mostly related to the @electron/asar behavior, however, it is a part of the template vite-typescript that I'm using, so it is posted here.
NOTE: For the webpack-typescript there is no issue, it works as expected with typeorm. The problem happens only when vite-typescript template is used!
The text was updated successfully, but these errors were encountered:
ifree92
changed the title
Unable to build the package using vite-typescript + typeorm library
Unable to package app on macOS using vite-typescript + typeorm library
Apr 12, 2024
An unhandled rejection has occurred inside Forge:
Error: Cannot copy '../errno/cli.js' to a subdirectory of itself, '../errno/cli.js'.
at /Users/niklaus/git/konty/node_modules/fs-extra/lib/copy/copy.js:213:21
at FSReqCallback.oncomplete (node:fs:187:23)
Tried to update @electron/asar@3.2.10, but still not work.
An unhandled rejection has occurred inside Forge:
Error: Cannot copy '../errno/cli.js' to a subdirectory of itself, '../errno/cli.js'.
at /Users/niklaus/git/konty/node_modules/fs-extra/lib/copy/copy.js:213:21
at FSReqCallback.oncomplete (node:fs:187:23)
Tried to update @electron/asar@3.2.10, but still not work.
It turns out that my issue is a problem with a specific package (optimization-js). After elimination of the package, build works well.
Pre-flight checklist
Electron Forge version
6.4.0, 6.3.1 as well (older version did not test)
Electron version
29.3.0
Operating system
macOS 14.4.1 (tried on Windows, no issues, seems this is specific for macOS)
Last known working Electron Forge version
No response
Expected behavior
The package process should finish without an error and provide a successful macOS build.
Actual behavior
Below is the console output of the
npm run package
command that ends with an error without a successful build.Steps to reproduce
I've been using NodeJS
20.9.0
, NPM version is10.1.0
.$ npm init electron-app@latest electron-experiments-vite-ts -- --template=vite-typescript $ cd electron-experiments-vite-ts $ npm i -S typeorm $ npm run package
You will get an error posted in "Actual Behavior" section. I even have no idea why is it happening.
But once
typeorm
is removed (npm uninstall typeorm
), now the build is successful. Kinda a "special" reaction on thetypeorm
.Additional information
I did not specify the config files here, cos it is reproducible using a raw vite-typescript template without any modifications.
In fact, the files by those symlinks exist:
Even in a temp folder:
Except
typeorm
, other packages also have symlinks from their.bin
folder to the specific JS files:Probably the issue is mostly related to the
@electron/asar
behavior, however, it is a part of the templatevite-typescript
that I'm using, so it is posted here.NOTE: For the
webpack-typescript
there is no issue, it works as expected withtypeorm
. The problem happens only whenvite-typescript
template is used!The text was updated successfully, but these errors were encountered: