Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Oct 2, 2025

PR Checklist

Overview

Bumps the package from ^8.1.1 to ^10.2.2.

Interestingly, this increases the lockfile size for local development dependencies. This is because [email protected] is still referenced by:

$ npm ls supports-color@5
[email protected] /Users/josh/repos/mocha
β”œβ”€β”¬ [email protected]
β”‚ └─┬ [email protected]
β”‚   └── [email protected]
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ @babel/[email protected]
      └─┬ @babel/[email protected]
        β”œβ”€β”¬ @babel/[email protected]
        β”‚ └─┬ [email protected]
        β”‚   └── [email protected]
        └─┬ [email protected]
          └── [email protected]

πŸ’–

@mark-wiemer
Copy link
Member

new test failure :(

@Uzlopak
Copy link
Member

Uzlopak commented Oct 3, 2025

@JoshuaKGoldberg
@mark-wiemer
Its because supports-color is esm only

@JoshuaKGoldberg
Copy link
Member Author

Ha yeah, I put these up as drafts with the intent of getting them to pass before requesting review. I was hoping there'd be no additional work but 🫠

@JoshuaKGoldberg
Copy link
Member Author

JoshuaKGoldberg commented Nov 27, 2025

Hmm. I can reproduce the CI failure locally in all of:

  • Branch: main and this PR's
  • Node.js version: 22.18.0 and 22.21.1
npx mocha test/integration/esm.spec.js


  esm
    βœ” should pass a passing esm test that uses esm (184ms)
    βœ” should fail a failing esm test that uses esm (177ms)
    βœ” should show file location when there is a syntax error in the test (162ms)
    βœ” should recognize esm files ending with .js due to package.json type flag (178ms)
    βœ” should enable requiring/loading a cjs module with "dir" as filename (173ms)
    βœ” should throw an ERR_MODULE_NOT_FOUND and not ERR_REQUIRE_ESM if file imports a non-existing module (228ms)
    1) should throw an ERR_MODULE_NOT_FOUND and not ERR_REQUIRE_ESM if file imports a non-existing module with a loader


  6 passing (1s)
  1 failing

  1) esm
       should throw an ERR_MODULE_NOT_FOUND and not ERR_REQUIRE_ESM if file imports a non-existing module with a loader:
     UnexpectedError: 
expected '(node:3315) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:\n--import \'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("./test/integration/fixtures/esm/loader-with-module-not-found/loader-that-recognizes-ts.mjs", pathToFileURL("./"));\'\n(Use `node --trace-warnings ...` to show where the warning was created)\n\nnode:internal/modules/run_main:123\n    triggerUncaughtException(\n    ^\nTypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file\n    at fileURLToPath (node:internal/url:1612:11)\n    at resolve (file:///Users/josh/repos/mocha/test/integration/fixtures/esm/loader-with-module-not-found/loader-that-recognizes-ts.mjs:15:5)\n    at nextResolve (node:internal/modules/esm/hooks:748:28)\n    at Hooks.resolve (node:internal/modules/esm/hooks:240:30)\n    at MessagePort.handleMessage (node:internal/modules/esm/worker:199:24)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:845:20)\n    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28) {\n  code: \'ERR_INVALID_URL_SCHEME\'\n}\n\nNode.js v22.21.1\n'
to contain 'ERR_MODULE_NOT_FOUND'

(node:3315) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("./test/integration/fixtures/esm/loader-with-module-not-found/loader-that-recognizes-ts.mjs", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)

node:internal/modules/run_main:123
    triggerUncaughtException(
    ^
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
    at fileURLToPath (node:internal/url:1612:11)
    at resolve (file:///Users/josh/repos/mocha/test/integration/fixtures/esm/loader-with-module-not-found/loader-that-recognizes-ts.mjs:15:5)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:199:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:845:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_URL_SCHEME'
}

Node.js v22.21.1


      at Context.<anonymous> (test/integration/esm.spec.js:100:5)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      set UNEXPECTED_FULL_TRACE=true to see the full stack trace
err.output alone

(node:37223) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("./test/integration/fixtures/esm/loader-with-module-not-found/loader-that-recognizes-ts.mjs", pathToFileURL("./"));'
    at createModuleLoader (node:internal/modules/esm/loader:970:17)
    at Object.getOrInitializeCascadedLoader (node:internal/modules/esm/loader:1014:22)
    at asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:106:65)
    at runEntryPointWithESMLoader (node:internal/modules/run_main:139:19)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:176:5)
    at node:internal/main/run_main_module:36:49

node:internal/modules/run_main:123
    triggerUncaughtException(
    ^
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
    at fileURLToPath (node:internal/url:1612:11)
    at resolve (file:///Users/josh/repos/mocha/test/integration/fixtures/esm/loader-with-module-not-found/loader-that-recognizes-ts.mjs:15:5)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:199:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:845:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28) {
  code: 'ERR_INVALID_URL_SCHEME'
}
Arguments to resolve
  • specifier: "file:///Users/josh/repos/mocha/lib/cli/cli.js"
  • context: {"conditions":["node","import","module-sync","node-addons"],"importAttributes":{}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ“¦ Package: Bump supports-color from 8 to 10

3 participants