-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Problem with linked npm packages and asar #675
Comments
Would also love to see a fix for this since it worked before in 4.x. |
I don't think this is ASAR-specific -- it's just that the error is more noisy when ASAR is enabled. It looks like the symlink just isn't getting dereferenced / followed. Packaging succeeds when ASAR is disabled, but that's because it just includes the addon's symlink in the app bundle as-is. In my case the symlink is relative, so the resulting bundle can't load the linked addon when it's installed in Applications as usual. |
@cwillisf check this out (link to source inside): electron/asar#85 |
Working on fix. |
BTW, you should never build production builds using npm linked modules. |
I know, but its convenient for developing sometimes : ) |
@develar Well, if you bundle everything and keep everything in 'devDependencies' then it's fine. |
@anri-asaturov No. Linked module copied AS IS, as the whole project — all node module development files, all node module dependencies including development — not pruned and not optimised (duplicated) will be included to production app. |
@develar i understand, but i don't have any 'dependencies' in my package.json and therefore no 'node-modules' in built app. Everything is bundled with webpack to 2 files 'electron.js' and 'renderer.js'. Why would 'devDependencies' get copied by electron-builder? They don't. |
@anri-asaturov So, your issue is completely different. Please attach sample project. If "i don't have any 'dependencies' in my package.json and therefore no 'node-modules' in built app" then electron-builder must not try to pack your linked module at all. |
@develar yes, you are right, I wasn't bundling electron process code when I stumbled into this problem, then I started bundling it too to avoid this issue. Sorry to cause confusion. |
next version: Set |
Any hints on how to potentially fix the 'copy as is' issue with linked packages? I could try to fix it. |
@anri-asaturov Please clarify — is your statement |
Currently, for the project I initially opened this issue for it's true, it's my workaround. |
Not clear for me — why you need to have packed app often. Why you cannot use electron-prebuilt? In any case — there is a workaround —
add this to your
This issue in any case should be fixed before, right? |
Linked module is supported in the upcoming electron-builder 11.2.0. Please note — linked module packed AS IS. Package module dir copied AS IS, not as result of |
I'm still facing the same problem with electron-builder 19.24.1 |
19.39.0 |
One of my node modules is linked via
npm link
and I get an error during build:Without linking it works fine.
The text was updated successfully, but these errors were encountered: