-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" after upgrade to 9.0.3 #4724
Comments
@buesing I have my doubts on this issue ... it works on v9.0.1, doesn't work on v9.0.2. But who knows. Without any sample to reproduce I'm going to close this issue within the next few days. I like closing issues. |
@juergba everybody likes closing issues 😄 |
So, first off, you are right, it's probably not a mocha issue. The thing that changed between version 9.0.2 and 9.0.3 is the error message.
Using mocha@9.0.3:
This is why I wrongly thought this was an issue with mocha. I assume that the underlying issue is the same, namely that the library I'm requiring here
|
@buesing Yes, with this topic you are stumbling into an experimental minefield. You will have to spend considerable amount of time to get into it, or to get out again. I can give you some tipps, then I will kindly lead you to the exit.
Edit: or don't update to Mocha v9, stay on v8. |
Yeah, I'm sticking with version 1.1.0 of the slugify package for now. Thanks! |
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
I just tried upgrading to 9.0.3 and i'm getting a
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts".
Running (obviously) on typescript, with the command
TS_NODE_PROJECT='./tsconfig.test.json' mocha -r ts-node/register -r tsconfig-paths/register 'src/**/*.test.ts'
.This is my tsconfig.test.json:
This used to work in 9.0.1
Steps to Reproduce
Run above code with the configuration on a .ts file using ES modules.
Expected behavior: The file is being loaded and executed
Actual behavior: An error is thrown
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts".
Reproduces how often: 100%
Versions
mocha --version
andnode node_modules/.bin/mocha --version
: 9.0.2node --version
: v14.16.1The text was updated successfully, but these errors were encountered: