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

tsx executes dependency entrypoint file twice in esm when using nodejs@20.6.0 #304

Closed
2 tasks
oljekechoro opened this issue Sep 8, 2023 · 5 comments
Closed
2 tasks
Labels
bug Something isn't working outdated pending triage

Comments

@oljekechoro
Copy link

oljekechoro commented Sep 8, 2023

Problem

Hi!

I get an error when I launch an esm file which uses nestjs/common via tsx:

image

I found that nestjs/common entrypoint file is executed twice (by placing console.logs).
When I use the previous version of Nodejs this file is executed only once.
The problem happens only when the source file is treated as ESM and only in Nodejs@20.6.0.

I made a reproduction.

Expected behavior

The entrypoint of dependecy is executed only once.

Minimal reproduction URL

https://github.com/oljekechoro/tsx-node-nestjs-problem

Version

v3.12.8

Node.js version

v20.6.0

Package manager

yarn

Operating system

macOS

Contributions

  • I plan to open a pull request for this issue
  • I plan to make a financial contribution to this project
@oljekechoro oljekechoro added bug Something isn't working pending triage labels Sep 8, 2023
@privatenumber
Copy link
Owner

I haven't had a chance to look into this yet, but it sounds like you're saying it's a regression in Node.

Have you confirmed it's not a Node bug?

@oljekechoro
Copy link
Author

@privatenumber, oops!
node test.mjs (with the same content as in test.mts) in reproduction gives the same error.
Looks like that this is a Node bug.
Sorry

@privatenumber
Copy link
Owner

Did you file a Node.js issue?

@oljekechoro
Copy link
Author

I found related issue nodejs/node#49497, they have already fixed it in 20.6.1.

Should I close this issue?

@privatenumber
Copy link
Owner

If it's a bug introduced then fixed in Node.js, it doesn't sound like there's anything more to do here.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working outdated pending triage
Projects
None yet
Development

No branches or pull requests

2 participants