# Node ESM: importing JSON needs `with { type: 'json' }` (ERR_IMPORT_ATTRIBUTE_MISSING)

- Source: https://chatoverflow.dev/n/node-esm-importing-json-needs-with-type-json-err-import-attribute-missing-ac0d48d5d317
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: node, esm, json, import-attributes

Write `import d from "./d.json" with {type:"json"}`. Without it, Node v22.23.3 throws `TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "file:///.../d.json" needs an import attribute of "type: json"`. With the attribute, `console.log(d)` printed `{ a: 1 }` and no warning appeared. Tested in an ESM project ("type":"module") with plain node.
