-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use default import of fix-path package #14812
Conversation
Electron app starts well with this patch. Thanks @msujew! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I verified it with 0d902cc, and it worked well.
From the main
branch (17d4667), I received the same error when I ran npm run all
:
ERROR in ./src-gen/backend/electron-main.js 9:0-19
Module not found: Error: Can't resolve 'fix-path' in '/Users/kittaakos/dev/git/theia/examples/electron/src-gen/backend'
resolve 'fix-path' in '/Users/kittaakos/dev/git/theia/examples/electron/src-gen/backend'
Parsed request is a module
using description file: /Users/kittaakos/dev/git/theia/examples/electron/package.json (relative path: ./src-gen/backend)
resolve as module
/Users/kittaakos/dev/git/theia/examples/electron/src-gen/backend/node_modules doesn't exist or is not a directory
/Users/kittaakos/dev/git/theia/examples/electron/src-gen/node_modules doesn't exist or is not a directory
/Users/kittaakos/dev/git/theia/examples/electron/node_modules doesn't exist or is not a directory
/Users/kittaakos/dev/git/theia/examples/node_modules doesn't exist or is not a directory
looking for modules in /Users/kittaakos/dev/git/theia/node_modules
single file module
using description file: /Users/kittaakos/dev/git/theia/package.json (relative path: ./node_modules/fix-path)
no extension
/Users/kittaakos/dev/git/theia/node_modules/fix-path doesn't exist
.js
/Users/kittaakos/dev/git/theia/node_modules/fix-path.js doesn't exist
.json
/Users/kittaakos/dev/git/theia/node_modules/fix-path.json doesn't exist
.wasm
/Users/kittaakos/dev/git/theia/node_modules/fix-path.wasm doesn't exist
/Users/kittaakos/dev/git/theia/node_modules/fix-path doesn't exist
/Users/kittaakos/dev/git/node_modules doesn't exist or is not a directory
/Users/kittaakos/dev/node_modules doesn't exist or is not a directory
/Users/kittaakos/node_modules doesn't exist or is not a directory
/Users/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the Electron app starts as expected.
@msujew @jfaltermeier Note that this a webpack-based solution if I'm not mistaken. So we should mark in the changelog that bundling the backend is now mandatory, as otherwise the Electron startup will fail. |
@msujew The previously used |
What it does
Closes #14804
Correctly uses the default import of the
fix-path
library. Since the 4.0.0 version is an ESM library, we need to calldefault()
explicitly. Additionally adjusts the imports used in the generated code to ensure that non-hoisting of libraries does not result in errors.How to test
node_modules
, ideally using something likegit clean -xfd
npm i && npm run build:electron && npm run start:electron
Review checklist
Reminder for reviewers