-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
@swc-node/register/esm doesn't recognize .ts
file
#710
Comments
same here |
same here, any news ? |
same issue. |
@3lang3 Do you use the same Node versions on both platforms? I see the original issue is using Node 14 which is not a supported LTS release anymore. |
this issue occurs on node v20.8.0 |
@Brooooooklyn After looking into the sources, I found that (at least under windows) the following if clause is causing the issue: swc-node/packages/register/register.ts Lines 69 to 73 in cc3d1da
The compile method of the loader is not transpiling the source file at all, since the filename and the included files provided by the tsconfig options are never equal. Removing the if-clause makes it work as expected. But after doing some benchmarks with the ESM loaders from @swc-node and @esbuild-kit, @esbuild-kit was almost twice as fast as @swc-node. So I'm definitely sticking with @esbuild-kit.. |
I can confirm that @philSixZero finding is the same issue for Windows. In my case when there are multiple workspaces in a project. I have a subproject which requires to load their own |
@Brooooooklyn @Phryxia I think that issue has been resolved via this commit |
I can confirm that it is a windows issue. I have tested this on Linux, Mac and Windows. If tsconfig.json exists in subfolder of a workspace it throws an error. If not tsconfig.json exists it runs fine even on Windows.
@nnnnoel Does that fix this as well? |
This is my dev script to run the dev server
It works perfectly fine. |
Reproduction Procedure
yarn
yarn dev
node
: 14.18.3@swc-node/register
: 1.6.0 ~ 1.6.4SWCRC=true node --loader @swc-node/register/esm index.ts
< 1.6
, this behavior fall back into can not register @swc-node/register/esm with ERR_PACKAGE_PATH_NOT_EXPORTED error #704.swcrc
Symptoms
As you can see, it doesn't recognize
.ts
. Also same with.mts
.Is it related to
.swcrc
recognition issues like #701 ?The text was updated successfully, but these errors were encountered: