Bug description
When I run tsx code.ts I get following output:
➜ esm-loader-warning-repro pnpm tsx code.ts
(node:76711) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
Hello esm-loader-warning-repro!
I expected:
Hello esm-loader-warning-repro!
I've noticed that we already suppress some warnings in here
Should we suppress this type of warning as well?
Reproduction
I have "type": "module" in my package.json:
{
"name": "esm-loader-warning-repro",
"version": "1.0.0",
"type": "module",
"dependencies": {
"tsx": "^3.12.7"
}
}
code.ts has following content:
import pack from "./package.json";
console.log(`Hello ${pack.name}!`);
I'm using Node 18:
➜ esm-loader-warning-repro pnpm tsx --version
tsx v3.12.7
node v18.16.0
Environment
System:
OS: macOS 13.2.1
CPU: (10) arm64 Apple M1 Max
Memory: 24.08 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
npmPackages:
tsx: ^3.12.7 => 3.12.7
Can you work on a fix?
Bug description
When I run
tsx code.tsI get following output:I expected:
Hello esm-loader-warning-repro!I've noticed that we already suppress some warnings in here
Should we suppress this type of warning as well?
Reproduction
I have
"type": "module"in mypackage.json:{ "name": "esm-loader-warning-repro", "version": "1.0.0", "type": "module", "dependencies": { "tsx": "^3.12.7" } }code.tshas following content:I'm using Node 18:
Environment
System: OS: macOS 13.2.1 CPU: (10) arm64 Apple M1 Max Memory: 24.08 GB / 64.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm npmPackages: tsx: ^3.12.7 => 3.12.7Can you work on a fix?