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

Cannot find module 'core-js/modules/es.array.iterator' #348

Closed
geraintwhite opened this issue May 27, 2020 · 3 comments
Closed

Cannot find module 'core-js/modules/es.array.iterator' #348

geraintwhite opened this issue May 27, 2020 · 3 comments

Comments

@geraintwhite
Copy link

Versions:

  • prettier-eslint version: 10.1.1
  • node version: 12.4.0
  • npm version: 6.9.0

What I did:

Ran prettier-eslint in vscode using prettier-vscode.

What happened:

["ERROR" - 2:35:24 PM] Error loading node module '/Users/geraintwhite/repos/work/newteam/cloud-voice-app/node_modules/prettier-eslint/dist/index.js'
["ERROR" - 2:35:24 PM] Cannot find module 'core-js/modules/es.array.iterator'
Require stack:
- /Users/geraintwhite/repos/work/newteam/cloud-voice-app/node_modules/prettier-eslint/dist/index.js
- /Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-amd.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork.js
Error: Cannot find module 'core-js/modules/es.array.iterator'
Require stack:
- /Users/geraintwhite/repos/work/newteam/cloud-voice-app/node_modules/prettier-eslint/dist/index.js
- /Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-amd.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork.js
	at Function.Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
	at Module._load (internal/modules/cjs/loader.js:622:27)
	at Module._load (electron/js2c/asar.js:717:26)
	at Function.Module._load (electron/js2c/asar.js:717:26)
	at Function.t._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:955:769)
	at Function.n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:925:106)
	at Function.i._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:921:391)
	at Module.require (internal/modules/cjs/loader.js:775:19)
	at n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:15:524)
	at Object.<anonymous> (/Users/geraintwhite/repos/work/newteam/cloud-voice-app/node_modules/prettier-eslint/dist/index.js:3:1)
	at Module.o._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:15:749)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
	at Module.load (internal/modules/cjs/loader.js:735:32)
	at Module._load (internal/modules/cjs/loader.js:648:12)
	at Module._load (electron/js2c/asar.js:717:26)
	at Function.Module._load (electron/js2c/asar.js:717:26)
	at Function.t._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:955:769)
	at Function.n._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:925:106)
	at Function.i._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:921:391)
	at Module.require (internal/modules/cjs/loader.js:775:19)
	at n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:15:524)
	at t.ModuleResolver.loadNodeModule (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:30473)
	at t.ModuleResolver.requireLocalPkg (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:29216)
	at t.ModuleResolver.getModuleInstance (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:28566)
	at t.default.<anonymous> (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:59538)
	at Generator.next (<anonymous>)
	at s (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:53984)
["ERROR" - 2:35:24 PM] Failed to load local module prettier-eslint.
["ERROR" - 2:35:24 PM] Cannot read property 'version' of undefined
TypeError: Cannot read property 'version' of undefined
	at t.ModuleResolver.requireLocalPkg (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:29370)
	at t.ModuleResolver.getModuleInstance (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:28566)
	at t.default.<anonymous> (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:59538)
	at Generator.next (<anonymous>)
	at s (/Users/geraintwhite/.vscode/extensions/esbenp.prettier-vscode-4.7.0/dist/extension.js:1:53984)
["INFO" - 2:35:25 PM] Formatting completed in 102.549735ms.

Problem description:

Looks like it was caused by this commit when core-js was removed from dependencies: 29e9d1e.

Suggested solution:

Should be resolved by re-adding core-js to dependencies.

@esetnik
Copy link

esetnik commented Jun 13, 2020

I opened #359 which should fix this issue.

chrisbobbe added a commit to zulip/zulip-mobile that referenced this issue Aug 11, 2020
This reverts commit 01593b3.

We should redo the upgrade when we can take a version of
`prettier-eslint` in which `core-js` is re-introduced as a
dependency; prettier/prettier-eslint#348 is the closest issue for
that. The commands listed in 01593b3 should make it easy to redo
the upgrade mechanically, and without having to think about rebase
conflicts.

The version (11.0.0) of `prettier-eslint` that we got in 01593b3
was affected by a bug with symptoms quite similar to ones we see
with the Prettier VSCode extension (a.k.a. `esbenp.prettier-vscode`)
at version 5 and above [1]. We'll have to resolve the problem with
the VSCode extension at some point (see discussion for a likely way
we'll do that), since we can't assume it will always be fine to stay
below version 5, and version 5 causes problems because of an
intentional design change.

But, from experimentation, it appears that this time the problem is
just caused by `prettier-eslint` not having the right version of
`core-js`. At 10.1.0, the latest version before the problem starts
happening, we can remove
`node_modules/prettier-eslint/node_modules/core-js`, and we see the
problem. Version 10.1.1, which ships with the problem, removed
`core-js` as a dependency, and an issue with a different bad symptom
(prettier/prettier-eslint#348) was soon filed, and a PR
(prettier/prettier-eslint#359) came along to add `core-js` back in.

[1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/SOLVED.3A.20Prettier.20auto-formatting/near/893164
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Aug 11, 2020
This reverts commit 01593b3.

We should redo the upgrade when we can take a version of
`prettier-eslint` in which `core-js` is re-introduced as a
dependency; prettier/prettier-eslint#348 is the closest issue for
that. The commands listed in 01593b3 should make it easy to redo
the upgrade mechanically, and without having to think about rebase
conflicts.

The version (11.0.0) of `prettier-eslint` that we got in 01593b3
was affected by a bug with symptoms quite similar to ones we see
with the Prettier VSCode extension (a.k.a. `esbenp.prettier-vscode`)
at version 5 and above [1]. We'll have to resolve the problem with
the VSCode extension at some point (see discussion for a likely way
we'll do that), since we can't assume it will always be fine to stay
below version 5, and version 5 causes problems because of an
intentional design change.

But, from experimentation, it appears that this time the problem is
just caused by `prettier-eslint` not having the right version of
`core-js`. At 10.1.0, the latest version before the problem starts
happening, we can remove
`node_modules/prettier-eslint/node_modules/core-js`, and we see the
problem. Version 10.1.1, which ships with the problem, removed
`core-js` as a dependency, and an issue with a different bad symptom
(prettier/prettier-eslint#348) was soon filed, and a PR
(prettier/prettier-eslint#359) came along to add `core-js` back in.

We can't just back up to version 10.1.0, because then we're at risk
of it not working with ESLint 6 [2]. So, just revert the entire
ESLint 6 upgrade.

[1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/SOLVED.3A.20Prettier.20auto-formatting/near/893164
[2] prettier/prettier-eslint#338 (comment)
gnprice pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Aug 11, 2020
This reverts commit 01593b3.

We should redo the upgrade when we can take a version of
`prettier-eslint` in which `core-js` is re-introduced as a
dependency; prettier/prettier-eslint#348 is the closest issue for
that. The commands listed in 01593b3 should make it easy to redo
the upgrade mechanically, and without having to think about rebase
conflicts.

The version (11.0.0) of `prettier-eslint` that we got in 01593b3
was affected by a bug with symptoms quite similar to ones we see
with the Prettier VSCode extension (a.k.a. `esbenp.prettier-vscode`)
at version 5 and above [1]. We'll have to resolve the problem with
the VSCode extension at some point (see discussion for a likely way
we'll do that), since we can't assume it will always be fine to stay
below version 5, and version 5 causes problems because of an
intentional design change.

But, from experimentation, it appears that this time the problem is
just caused by `prettier-eslint` not having the right version of
`core-js`. At 10.1.0, the latest version before the problem starts
happening, we can remove
`node_modules/prettier-eslint/node_modules/core-js`, and we see the
problem. Version 10.1.1, which ships with the problem, removed
`core-js` as a dependency, and an issue with a different bad symptom
(prettier/prettier-eslint#348) was soon filed, and a PR
(prettier/prettier-eslint#359) came along to add `core-js` back in.

We can't just back up to version 10.1.0, because then we're at risk
of it not working with ESLint 6 [2]. So, just revert the entire
ESLint 6 upgrade.

[1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/SOLVED.3A.20Prettier.20auto-formatting/near/893164
[2] prettier/prettier-eslint#338 (comment)
@github-actions
Copy link
Contributor

Stale issue

@exah
Copy link

exah commented Dec 1, 2020

Please re-open, PR not merged yet :)

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

Successfully merging a pull request may close this issue.

3 participants