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

@babel/helper-validator-identifier can’t be required #11878

Closed
1 task done
alex-kinokon opened this issue Jul 26, 2020 · 2 comments
Closed
1 task done

@babel/helper-validator-identifier can’t be required #11878

alex-kinokon opened this issue Jul 26, 2020 · 2 comments
Labels
area: upstream i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@alex-kinokon
Copy link

alex-kinokon commented Jul 26, 2020

Bug Report

Fix is available below.

  • I would like to work on a fix!

Current behavior

mkdir test && cd test
yarn init --yes
yarn add @babel/helper-validator-identifier
node

Welcome to Node.js v14.6.0.
Type ".help" for more information.
> require('@babel/helper-validator-identifier')
Uncaught:
TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module "/test/node_modules/@babel/helper-validator-identifier/lib/index.js" must not include encoded "/" or "\" characters imported from /test/node_modules/@babel/helper-validator-identifier/
    at resolveExportsTarget (internal/modules/cjs/loader.js:564:15)
    at applyExports (internal/modules/cjs/loader.js:469:14)
    at resolveExports (internal/modules/cjs/loader.js:522:23)
    at Function.Module._findPath (internal/modules/cjs/loader.js:654:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1052:27)
    at Function.Module._load (internal/modules/cjs/loader.js:911:27)
    at Module.require (internal/modules/cjs/loader.js:1125:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at repl:1:1
    at Script.runInThisContext (vm.js:132:18) {
  code: 'ERR_INVALID_MODULE_SPECIFIER'
}

Expected behavior
It works.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
N/A

Environment

  • Babel version(s): 7.10.4
  • Node/npm version: v14.6.0
  • OS: macOS Catalina
  • Monorepo: no
  • How you are using Babel: Node.js

Possible Solution

Remove exports field from package.json and it will work.

Additional context
Add any other context about the problem here. Or a screenshot if applicable

=== Edits by @JLHwung ===
Solution
Update node to v14.7.0.

@babel-bot
Copy link
Collaborator

Hey @proteriax! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@JLHwung
Copy link
Contributor

JLHwung commented Jul 26, 2020

I believe it is a bug of node REPL, because the following example does not throw

node -e "require('@babel/helper-validator-identifier')"

Update: nodejs/node#34521

@JLHwung JLHwung closed this as completed Aug 5, 2020
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 5, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: upstream i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

3 participants