-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
[Bug] Usage of node:
imports for builtin modules
#11637
Labels
Comments
chadoh
added a commit
to near/near-workspaces-js
that referenced
this issue
Aug 18, 2021
XO is a wrapper around eslint: https://github.com/xojs/xo * add precommit hooks with husky * drop support for node 15 Needed to override `node:` import prefix because it is incompatible with Jest (jestjs/jest#11637)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
🐛 Bug Report
With the arrival of Node.js v16, we can now use
node:
to load Node.js builtin modules withrequire
.See: https://nodejs.org/api/esm.html#esm_node_imports
But currently with
jest
, we can't, it fails.To Reproduce
Steps to reproduce the behavior (it is a stupid example, only to show the error):
In a file
lib.js
:And a file
lib.test.js
:Expected behavior
To make it work again, I need to change
const path = require('node:path')
toconst path = require('path')
.Problematic code
https://github.com/facebook/jest/blob/7a64ede2163eba4ecc725f448cd92102cd8c14aa/packages/jest-runtime/src/index.ts#L1909-L1919
envinfo
The text was updated successfully, but these errors were encountered: