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

Projects
None yet
4 participants
@jack-teng1
Contributor

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 electron/reviewers as a code owner Jun 18, 2018

@welcome

This comment has been minimized.

Show comment
Hide comment
@welcome

welcome bot 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.

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

This comment has been minimized.

Show comment
Hide comment
@MarshallOfSound

MarshallOfSound Jun 18, 2018

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?

Member

MarshallOfSound commented Jun 18, 2018

@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?

@jack-teng1 jack-teng1 requested review from electron/docs as code owners Jun 19, 2018

@jack-teng1

This comment has been minimized.

Show comment
Hide comment
@jack-teng1

jack-teng1 Jun 19, 2018

Contributor

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

Contributor

jack-teng1 commented Jun 19, 2018

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

@alexeykuzmin

This comment has been minimized.

Show comment
Hide comment
@alexeykuzmin

alexeykuzmin Jun 19, 2018

Contributor

@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

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

jack-teng1 added some commits Jun 18, 2018

fix: can't load module error when app is packaged
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.
spec: fix asar spec due to change in node.js
node.js rename the internalModuleReadFile to internalModuleReadJSON
change spec to reflect this change

@jack-teng1 jack-teng1 changed the base branch from upgrade-to-chromium-66 to master Jun 19, 2018

@jack-teng1

This comment has been minimized.

Show comment
Hide comment
@jack-teng1

jack-teng1 Jun 19, 2018

Contributor

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

Contributor

jack-teng1 commented Jun 19, 2018

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

@jkleinsc

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

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

10 checks passed

WIP ready for review
Details
ci/circleci: electron-linux-arm Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-ia32 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-x64 Your tests passed on CircleCI!
Details
ci/circleci: electron-mas-x64 Your tests passed on CircleCI!
Details
ci/circleci: electron-osx-x64 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@welcome

This comment has been minimized.

Show comment
Hide comment
@welcome

welcome bot Jun 19, 2018

Congrats on merging your first pull request! 🎉🎉🎉

welcome bot commented Jun 19, 2018

Congrats on merging your first pull request! 🎉🎉🎉

@alexeykuzmin

This comment has been minimized.

Show comment
Hide comment
@alexeykuzmin

alexeykuzmin Jun 19, 2018

Contributor

@jack-teng1 Thank you!

Contributor

alexeykuzmin commented Jun 19, 2018

@jack-teng1 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment