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

[BUG] needs an import assertion of type "json" #58

Open
ev-d opened this issue Feb 14, 2024 · 0 comments
Open

[BUG] needs an import assertion of type "json" #58

ev-d opened this issue Feb 14, 2024 · 0 comments

Comments

@ev-d
Copy link

ev-d commented Feb 14, 2024

Description

TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///user/home/pontem/liquidswap-api/node_modules/@pontem/coins-registry/src/staking.json" needs an import assertion of type "json"

This issue tested in NodeJS v18.14 and above

Other platforms

On bun v1.26 platform the package works fine with and without assertion
Didn't test on Deno

Solution:

in the index.js file, please add assertion with type 'json'

Example

/**
 * Known coins
 */
import coins from './coins.json' assert { type: 'json' };
/**
 * Known pools
 */
import pools from './pools.json' assert { type: 'json' };
/**
 * Known staking pools
 */
import staking from './staking.json' assert { type: 'json' };

Resource

V8 blog

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

1 participant