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

fix(issue #30): json module assertion issue for node version < 17.5.0 #31

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

wajeshubham
Copy link
Collaborator

@wajeshubham wajeshubham commented Jul 21, 2023

Context

From Node.js version 17.5.0 onward, importing a JSON file is possible using Import Assertions:

Possible Solution

According to the compatibility tables on MDN for import declarations and dynamic import, older versions of Node.js (16.0.0 – 16.14.0 and 17.0.0 – 17.4.0) had varying support:

These versions required the --experimental-json-modules flag:

nodemon -r dotenv/config --experimental-json-modules src/index.js

Copy link
Collaborator

@jwala-anirudh jwala-anirudh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@wajeshubham wajeshubham merged commit 661f1f2 into main Jul 21, 2023
@wajeshubham wajeshubham deleted the fix/json-module branch July 21, 2023 07:36
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

Successfully merging this pull request may close these issues.

2 participants