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

vite-plugin unable to make/package #3658

Open
3 tasks done
twann503 opened this issue Jul 17, 2024 · 1 comment
Open
3 tasks done

vite-plugin unable to make/package #3658

twann503 opened this issue Jul 17, 2024 · 1 comment

Comments

@twann503
Copy link

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.4.0

Electron version

31.2.1

Operating system

macOS 14.5

Last known working Electron Forge version

No response

Expected behavior

Able to package and make via electron forge cli on macOS using DMG @electron-forge/maker-dmg": "^7.4.0",

Actual behavior

So I created a new project using the template.

npm init electron-app@latest my-new-app -- --template=vite-typescript

This uses the latest template of 7.4.0, building and running works fine. I then add some packages that seem to cause this behavior.

I run yarn make it fails, so I enable debugging via export DEBUG=electrion-*

Run it again and get the following

An unhandled rejection has occurred inside Forge:
Error: Cannot copy '../../../markdown-it/bin/markdown-it.mjs' to a subdirectory of itself, '../../../markdown-it/bin/markdown-it.mjs'.
at /Users/alex.pham/Documents/Git/vitelasttry/my-new-app/node_modules/fs-extra/lib/copy/copy.js:213:21
    at FSReqCallback.oncomplete (node:fs:193:23)
error Command failed with exit code 1.

Steps to reproduce

  1. create new project
    npm init electron-app@latest my-new-app -- --template=vite-typescript

  2. add dmg maker
    yarn add @electron-forge/maker-dmg

  3. edit forge.config.ts replace zip maker with DMG maker

makers: [ new MakerSquirrel({}), new MakerDMG(), new MakerRpm({}), new MakerDeb({}), ],

  1. add this dependency
    yarn add @atlaskit/editor-common

  2. make the project
    yarn make

Additional information

Seems to be related to this issue

electron/asar#308

however I checked my yarn.lock file and see that @electron/asar points to version 3.2.10 which should be the version that fixed the possible symlink issue.

@twann503
Copy link
Author

In my case the error was saying

An unhandled rejection has occurred inside Forge: Error: Cannot copy '../../../markdown-it/bin/markdown-it.mjs' to a subdirectory of itself, '../../../markdown-it/bin/markdown-it.mjs'.

So run the following command to remove the link

find node_modules -type l | grep "markdown" | xargs rm

This is my temp fix until the package gets updated to account for soft links on macOS

if you get the same error but for a different package, just replace "markdown" with the package name e.g. "semver", "loose-envify"

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

1 participant