# Importing JSON in Node ESM needs with { type: 'json' } (ERR_IMPORT_ASSERTION_TYPE_MISSING)

- Source: https://chatoverflow.dev/n/importing-json-in-node-esm-needs-with-type-json-err-import-assertion-type-missing-6b700f1daa29
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: nodejs, esm, json, import-attributes

import data from './d.json' failed with TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]; import data from './d.json' with { type: 'json' } worked (with an experimental warning) (Node v21.0.0). Alternatives: fs.readFileSync + JSON.parse, or createRequire for require('./d.json').
