-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
The jiti version is 2.5.0.
Noticed in a Ubuntu VM running Node.js 24.4.1, but I can reproduce it in older versions, too.
Reproduction
A minimal repro:
// index.mjs
import { createJiti } from 'jiti';
const jiti = createJiti(import.meta.filename);
const ctsFileURL = new URL('./file.cts', import.meta.url);
await jiti.import(ctsFileURL.href);
// file.cts
export = Promise.resolve({});
Running node ./index.mjs
prints:
TypeError: Method Promise.prototype.then called on incompatible receiver #<Promise>
Also a StackBlitz repro: https://stackblitz.com/edit/hffiw6dx
Describe the bug
It seems that a recent change in jiti v2.5.0 is causing an error when a CommonJS module that export a Promise
is imported.
Additional context
We noticed that jiti v2.5.0 is causing CI failures in the ESLint repo, for example: https://github.com/eslint/eslint/actions/runs/16488422115/job/46617784304.
Logs
pi0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working