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

"Error: Cannot find module 'jsonfile/utils'" in linux appimage build #8503

Open
cmdcolin opened this issue Sep 19, 2024 · 7 comments
Open

"Error: Cannot find module 'jsonfile/utils'" in linux appimage build #8503

cmdcolin opened this issue Sep 19, 2024 · 7 comments

Comments

@cmdcolin
Copy link

cmdcolin commented Sep 19, 2024

  • Electron-Builder Version:

"[email protected]"

  • Node Version:
    20.17.0/x64 on github actions
  • Target:
    AppImage

Latest build of AppImage fails to start with error message:

 ./jbrowse-desktop-v2.15.3-linux.AppImage
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'jsonfile/utils'
Require stack:
- /tmp/.mount_jbrowsjehAMT/resources/app.asar/node_modules/electron-updater/node_modules/fs-extra/lib/json/output-json.js
- /tmp/.mount_jbrowsjehAMT/resources/app.asar/node_modules/electron-updater/node_modules/fs-extra/lib/json/index.js
- /tmp/.mount_jbrowsjehAMT/resources/app.asar/node_modules/electron-updater/node_modules/fs-extra/lib/index.js
- /tmp/.mount_jbrowsjehAMT/resources/app.asar/node_modules/electron-updater/out/main.js
- /tmp/.mount_jbrowsjehAMT/resources/app.asar/build/electron.js
-
    at Module._resolveFilename (node:internal/modules/cjs/loader:1232:15)
    at s._resolveFilename (node:electron/js2c/browser_init:2:124039)
    at Module._load (node:internal/modules/cjs/loader:1058:27)
    at c._load (node:electron/js2c/node_init:2:17025)
    at Module.require (node:internal/modules/cjs/loader:1318:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/tmp/.mount_jbrowsjehAMT/resources/app.asar/node_modules/electron-updater/node_modules/fs-extra/lib/json/output-json.js:3:23)
    at Module._compile (node:internal/modules/cjs/loader:1484:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
    at Module.load (node:internal/modules/cjs/loader:1295:32)

if i unzip the app.asar file, i can see that there is a app.asar/node_modules/jsonfile but that is v4, while the fs-extra there wants v6

here are some screenshots, see filename paths pointing the the node_modules directory that i unzipped from the app.asar file with "npx @electron/asar extract app.asar outdir"

image

image

I normally use "yarn" (v1) to install my node_modules in my normal monorepo, but am unsure how the node_modules directory is constructed for this project. I haven't yet traced the exact root cause, but seems something with the node_modules directory format/construction in the app.asar

i update versions of stuff a lot so dont know exactly the cause. this is the entire diff of the yarn.lock between a version that works (did not give the above error) and a version that gave the error. i didn't see anything that really stood out (no fs-extra changes, no jsonfile changes, no electron-builder changes, no electron-updater changes

if i had one question, it would probably be how the node_modules in the app.asar is created?

this is the full diff between a working version of our app and the failing https://github.com/GMOD/jbrowse-components/compare/v2.15.1..v2.15.3/ (v2.15.2 was skipped)

@cmdcolin
Copy link
Author

note that the app works on mac. im not currently building any other linux targets

@cmdcolin
Copy link
Author

weirdly, this AppImage instance was built via a github action, but if i build it locally, it seemed to work (??)

@cmdcolin
Copy link
Author

a similar bug here suggests deleting the lockfile and re-installing storybookjs/storybook#22682 but i am not sure if that would apply in my case because the local build i mention above has the same yarn.lock as the github action

@mmaietta
Copy link
Collaborator

@cmdcolin was this working previoiusly on 24.13.3? Just looking to triage if this was recently introduced.

@cmdcolin
Copy link
Author

the diff at https://github.com/GMOD/jbrowse-components/compare/v2.15.1..v2.15.3/ actually didnt have anything related to electron builder, electron-updater, fs-extra, or jsonfile (all the culprits from thw stack trace) so it is wuite odd. we previously used electron build3r 24, had a successful release with v25 in with our products v2.15.1, but had this happem in latest v2.15.3

If its too weird a bug could certainly close. thw fact i built the same thing locally instead of via github action akd it worked suggests some nondeterminism or other weird thing (my local is otherwise quite similar to the github action on os, emvironment, etc)

@beyondkmp
Copy link
Collaborator

@cmdcolin Could you help to try v25.1.3 ?

@cmdcolin
Copy link
Author

I can give it a shot, might be a little bit till i am able to get around to it! am I correct in thinking that the 'conflictDependency' mentioned there could be relevant to this?

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

3 participants