jest icon indicating copy to clipboard operation
jest copied to clipboard

Update jest-validate/utils.ts to import chalk as ESM

Open eric-blue opened this issue 1 year ago • 3 comments

will update the changelog if this is a valid change

Summary

attempting to run experimental vm modules throws this error

> node --experimental-vm-modules node_modules/.bin/jest

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/.../node_modules/chalk/source/index.js from /Users/.../node_modules/jest-validate/build/utils.js not supported.
Instead change the require of index.js in /Users/.../node_modules/jest-validate/build/utils.js to a dynamic import() which is available in all CommonJS modules.
    at _chalk (/Users/.../node_modules/jest-validate/build/utils.js:16:39)
    at Object.<anonymous> (/Users/.../node_modules/jest-validate/build/utils.js:46:16)

Test plan

following the usage docs for chalk https://github.com/chalk/chalk?tab=readme-ov-file#usage

eric-blue avatar Jun 28 '24 18:06 eric-blue

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: eric-blue / name: Eric Berndt (67a291543262c7ec4a347ec58447725a9b73e546, 8dd4d3882478b3102de6c0b1843f1154fe31c9b1)

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
Latest commit 8dd4d3882478b3102de6c0b1843f1154fe31c9b1
Latest deploy log https://app.netlify.com/sites/jestjs/deploys/667f1a5cb7a88700080b390e
Deploy Preview https://deploy-preview-15151--jestjs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jun 28 '24 18:06 netlify[bot]

This seems like a missing dependency (or package manager bug) as we depend on a CJS version of chalk. Do you have a reproduction?

SimenB avatar Jun 29 '24 13:06 SimenB

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

github-actions[bot] avatar Aug 23 '24 00:08 github-actions[bot]