Skip to content
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] [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for #3221

Closed
acomito opened this issue Feb 12, 2021 · 2 comments

Comments

@acomito
Copy link

acomito commented Feb 12, 2021

We can't import a json file in node 14+ using import syntax?

@RaisinTen
Copy link
Contributor

You can using --experimental-json-modules though it is still experimental now.
Ref: https://nodejs.org/api/esm.html#esm_json_modules

@acomito acomito closed this as completed Feb 20, 2021
@AhmadRaza9
Copy link

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for D:\Installations\laragon\www\wp-pre-theme\wp-content\themes\firsttheme\package.json
at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:71:15)
at Loader.getFormat (internal/modules/esm/loader.js:102:42)
at Loader.getModuleJob (internal/modules/esm/loader.js:231:31)
at async ModuleWrap. (internal/modules/esm/module_job.js:58:21)
at async Promise.all (index 10)
at async link (internal/modules/esm/module_job.js:63:9) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants