Skip to content

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

@ev-d

Description

@ev-d

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions