jiti icon indicating copy to clipboard operation
jiti copied to clipboard

[email protected] is required uncorrect

Open Sara2009 opened this issue 2 years ago • 1 comments

Environment

nodejs: v18.1.0

Reproduction

just run test.js with the code as blow.

Describe the bug

I use nuxt3 to creat web app. Nuxt3 use jiti to resolve module. The function require is modified by jiti.

const { transports } = require("winston");

console.log('winston', transports);

const jiti1 = require("jiti")(process.cwd(), { interopDefault: true, esmResolve: true });

const { transports: transports1 } = jiti1("winston");

console.log('jiti1', transports1);

const jiti2 = require("jiti")(process.cwd());

const { transports: transports2 } = jiti2("winston");

console.log('jiti2', transports2);

The output of jiti1 is wrong if i set { interopDefault: true, esmResolve: true }.

image

Additional context

No response

Logs

No response

Sara2009 avatar Oct 09 '23 09:10 Sara2009

repo: https://github.com/Sara2009/bug-report-jiti

run: node ./jiti-winston.js

Sara2009 avatar Oct 18 '23 09:10 Sara2009

This issue happens with interopDefault being enabled (which is disabled by default).

pi0 avatar Sep 25 '24 15:09 pi0