Closed rzec-allma closed 1 year ago
Sorry, I have no idea and the environment stack here is too big for debug.
Did you change any config during the update?
Nope, the only difference between working and not working is v3.3.4 (working) and v4.0.0 (not working) of nanoid
.
Sorry, still have no idea.
Let’s keep it open, maybe somebody will know the answer.
Don’t worry to use v3, it is officially supported.
Same issue here. Upgrading to 4.0.0 causes ts-mocha (which uses ts-node) to throw Error: unknown file extension .ts
It could be related to the commit where "type": "module"
was added to package.json (4f5544255f3aba912c7662aca0434a4506953c5c), as some commenters posted in this thread https://github.com/TypeStrong/ts-node/issues/1062.
Downgrading to 3.3.4 removes the errors, and my tests run again.
I have this exact issue. Downgrading the nanoid from v4 to v3.3.4 solved it.
I am using
nanoid
v4 in a NextJS application and while the library works fine in the application itself, when I run any unit tests that include code that usingnanoid
, I get this error:TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/ryanzec/repositories/allma-web-app/mocha-setup.ts
My
tsconfig.json
is:I know there is a similar issue related to v4 in node however that issue in that seems to be related specifically to importing not working and not the error I am getting. The unit tests work fine with v3 so I assume it is related to the ESM change though not sure why it is not working since I am using
esnext
in mytsconfig.json
.While I can and will use v3, just wanted to point this out to see if there is something I am doing wrong or something that needs to be fixed with the library itself.