Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winston@3.9.0 is required uncorrect #177

Open
Sara2009 opened this issue Oct 9, 2023 · 1 comment
Open

winston@3.9.0 is required uncorrect #177

Sara2009 opened this issue Oct 9, 2023 · 1 comment

Comments

@Sara2009
Copy link

Sara2009 commented Oct 9, 2023

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
Copy link
Author

Sara2009 commented Oct 18, 2023

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

run: node ./jiti-winston.js

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

No branches or pull requests

1 participant