-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
ERR_UNKNOWN_FILE_EXTENSION after adding "type": "module" to package.json #1171
Comments
Are you following the instructions from here? #1007
|
Typically you should have your tsconfig set to @realmayus let me know if this works or not. |
Thanks, that worked 👍 |
I am having the same issue:
However, |
@guoyunhe check this out |
use |
I tried but no luck. |
after i added
|
any solution? I am facing same problem |
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for D:\Installations\laragon\www\wp-pre-theme\wp-content\themes\firsttheme\package.json |
Node has restrictions about JSON files in ESM, maybe you're hitting that. |
I have no idea, i can't understand 😒 |
@cspotcode. Could you kindly expound on this. Seems really interesting. And how can we mitigate this problem? |
Node's documentation has everything you need. |
|
I tried to create a test file to test the structure of my typescript code.
test/index.ts
When i executed it, i got this error:
After a bit of research, I found this issue which suggested adding
"type": "module"
to the package.json. After I did this, i got the following error:How can I run my file now? I am using ES6 (?) imports in the Player class:
export default class Player {}
Specifications
The text was updated successfully, but these errors were encountered: