-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
yarn test
(node --run test
) fails in Node.js 22.12 due to requiring top-level await module
#16930
Comments
We have to |
This makes the test work again, but I don't want Prettier to set it because it's just a makeshift: git diff package.json
diff --git a/package.json b/package.json
index 49cdf6f39..b082612f4 100644
--- a/package.json
+++ b/package.json
@@ -158,7 +158,7 @@
},
"scripts": {
"prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1",
- "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
+ "test": "cross-env NODE_OPTIONS=\"--no-experimental-require-module --experimental-vm-modules\" jest --runInBand",
"test:dev-package": "cross-env INSTALL_PACKAGE=1 yarn test",
"test:dist": "cross-env NODE_ENV=production yarn test",
"test:dist-standalone": "cross-env TEST_STANDALONE=1 yarn test:dist",
↑ These look like culprits. I think we need to make all test scripts modules. |
22.12 introduced require(esm) without flag: nodejs/node#55217, but it looks like incompatible with the current test code of Prettier. |
yarn test
(node --run test
) fails in Node.js 22.12yarn test
(node --run test
) fails in Node.js 22.12 due to requiring top-level await module
Environments:
Steps to reproduce:
Expected behavior:
(Test succeeds twice)
Actual behavior:
↓
The text was updated successfully, but these errors were encountered: