privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
8.61k stars 132 forks source link

webpack-cli (v5.1.4) doesn't work with tsx(v4.14.0) for webpack.config.ts #584

Closed Dmitriy-Frostoff closed 3 weeks ago

Dmitriy-Frostoff commented 3 weeks ago

Acknowledgements

Minimal reproduction URL

https://github.com/Dmitriy-Frostoff/boilerplate-webpack-gulp-html-scss-ts-components

Problem & expected behavior (under 200 words)

What were you expecting to happen?

I expected to get the bundle (developmaent, production ones).

What actually happened?

I got errors in the terminal output.

Terminal output / screenshots

$ npm run dev

> boilerplate-webpack-gulp-html-scss-ts-components@1.0.0 dev
> cross-env NODE_OPTIONS='--import=tsx' TSX_TSCONFIG_PATH='./configs/ts/tsconfig.json' webpack --config ./configs/webpack/webpack.co
nfig.ts --node-env=development --progress

[webpack-cli] Unable load 'E:\Code learning\boilerplate-webpack-gulp-html-scss-ts-components\configs\webpack\webpack.config.ts'
[webpack-cli] Unable to use specified module loaders for ".ts".
[webpack-cli] Cannot find module 'ts-node/register' from 'E:\Code learning\boilerplate-webpack-gulp-html-scss-ts-components\configs\
webpack'
[webpack-cli] Cannot find module 'sucrase/register/ts' from 'E:\Code learning\boilerplate-webpack-gulp-html-scss-ts-components\confi
gs\webpack'
[webpack-cli] Cannot find module '@babel/register' from 'E:\Code learning\boilerplate-webpack-gulp-html-scss-ts-components\configs\w
ebpack'
[webpack-cli] Cannot find module 'esbuild-register/dist/node' from 'E:\Code learning\boilerplate-webpack-gulp-html-scss-ts-component
s\configs\webpack'
[webpack-cli] Cannot find module '@swc/register' from 'E:\Code learning\boilerplate-webpack-gulp-html-scss-ts-components\configs\webpack'
[webpack-cli] Please install one of them

Please provide the following information:

OS & version [e.g. MacOS Catalina 10.15.4]: Windows 10 Pro v1803 (i.e. Windows 10 v10.0.17134) node version (run node -v): v21.7.1 npm version (run npm -v): 10.8.1 webpack-cli version (run npx webpack -v): 5.1.4 tsx version (run npx tsx -v): 4.14.0

(more details via package.json s at boilerplate-webpack-gulp-html-scss-ts-components
I use ESM and "type": "module", in the package.json )

Steps to reproduce:

npm run dev

works fine;

npm run dev

or

npm run build

Additional information

The exceptions are emitted only via actual tsx v4.14.0 usage, previous one (v4.12.0) works fine.
I hope it'll help to find the problem... If there's any additional info required I'll immediately provide it!)) Sorry 🙏 for more than 200 words, but I hope it worth it... Thanks! tsx is marvelous tool!!!))

Bugs are expected to be fixed by those affected by it

Compensating engineering work financially will speed up resolution

privatenumber commented 3 weeks ago

Thanks for the issue @Dmitriy-Frostoff

Please provide a minimal reproduction next time as it puts work on me to debug an unnecessarily large codebase.

privatenumber commented 3 weeks ago

:tada: This issue has been resolved in v4.14.1

If you appreciate this project, please consider supporting this project by sponsoring :heart: :pray:

Dmitriy-Frostoff commented 3 weeks ago

Dear Hiroki Osame, Thank you so much for your kindness and understanding. I sincerely apologize for the extensive code in my previous report that required more of your time to dig through. I've clearly understood the importance of providing only the relevant code to reproduce the issue and narrow down the testing scope. I will ensure to do so in future contributions!)))) 🙏🙏🙏🙏 Best regards, Dmitriy Frostoff