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

fix: can't load module error when app is packaged #13283

Merged
merged 2 commits into from
Jun 19, 2018

Conversation

jack-teng1
Copy link
Contributor

@jack-teng1 jack-teng1 commented Jun 18, 2018

Due to change in node.js(nodejs/node#17076) internalModuleReadFile has been renamed to internalModuleReadJSON, and in vendor/node/lib/internal/modules/cjs/loader.js it will call internalModuleReadJSON and result in can't read the package.json file.

Fixes #13185.

@jack-teng1 jack-teng1 requested a review from a team June 18, 2018 23:16
@welcome
Copy link

welcome bot commented Jun 18, 2018

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix, OR prefix at least one of your commit messages.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@MarshallOfSound
Copy link
Member

@jack-teng1 The tests are failing with internalModuleReadFile is not a function. We currently have a spec for internalModuleReadFile that indicates if it is working, it appears to still be functioning. Can you validate that the method you are trying to wrap actually exists?

@MarshallOfSound MarshallOfSound force-pushed the upgrade-to-chromium-66 branch from 039b074 to efdf4f4 Compare June 19, 2018 01:50
@jack-teng1 jack-teng1 requested review from a team June 19, 2018 16:41
@jack-teng1
Copy link
Contributor Author

@MarshallOfSound I updated the spec to reflect the change in node.js. internalModuleReadFile is now renamed to internalModuleReadJSON

@alexeykuzmin
Copy link
Contributor

alexeykuzmin commented Jun 19, 2018

@jack-teng1 Can you please rebase your branch onto electron:master?, and set master as a target branch?
upgrade-to-chromium-66 has been rebased and merged into it.

Just in case you need some help with Git =)

git checkout fix-asar-pack-cant-find-module
git fetch upstream # <- electron/electron remote
git rebase --onto upstream/master @~2 fix-asar-pack-cant-find-module
git push --force origin fix-asar-pack-cant-find-module  # <- jack-teng1/electron remote

due to change in node.js(nodejs/node#17076)
internalModuleReadFile has been renamed to internalModuleReadJSON, and
in vendor/node/lib/internal/modules/cjs/loader.js it will call
internalModuleReadJSON and result in can't read the package.json file.
node.js rename the internalModuleReadFile to internalModuleReadJSON
change spec to reflect this change
@jack-teng1 jack-teng1 force-pushed the fix-asar-pack-cant-find-module branch from 09255c6 to 3044607 Compare June 19, 2018 17:46
@jack-teng1 jack-teng1 changed the base branch from upgrade-to-chromium-66 to master June 19, 2018 17:46
@jack-teng1
Copy link
Contributor Author

Thank you @alexeykuzmin, I have rebase the branch on to master

Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the PR @jack-teng1!

@jkleinsc jkleinsc merged commit fc12b5c into electron:master Jun 19, 2018
@welcome
Copy link

welcome bot commented Jun 19, 2018

Congrats on merging your first pull request! 🎉🎉🎉

@alexeykuzmin
Copy link
Contributor

@jack-teng1 Thank you!

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

Successfully merging this pull request may close these issues.

4 participants