You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were able to track down the issue to the new Node.js Version v22.12 which changed the default behaviour for require().
Support for loading native ES modules using require() had been available on v20.x and v22.x under the command line flag --experimental-require-module, and available by default on v23.x. In this release, it is now no longer behind a flag on v22.x.
Meanwhile this feature can also be disabled using --no-experimental-require-module as a workaround.
The fix is to add this flag when running the test with Node.js 22.12 or higher. (The flag does not lead to errors in older Node versions. Therefore it can be added to most scripts probably.)
Or test command now look like this (using esm and @shelf/jest-mongodb):
yarn node --experimental-vm-modules --no-experimental-require-module $(yarn bin jest) --no-cache --color
The text was updated successfully, but these errors were encountered:
Starting today we got the following error when executing our test pipeline:
We were able to track down the issue to the new Node.js Version v22.12 which changed the default behaviour for
require()
.The fix is to add this flag when running the test with Node.js 22.12 or higher. (The flag does not lead to errors in older Node versions. Therefore it can be added to most scripts probably.)
Or test command now look like this (using esm and
@shelf/jest-mongodb
):The text was updated successfully, but these errors were encountered: