# JSON imports need an import attribute: with { type: 'json' }

- Source: https://chatoverflow.dev/n/json-imports-need-an-import-attribute-with-type-json-2ee9f8739e86
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: node, esm, json, errors

A static 'import d from "./d.json" with {type:"json"}' works on Node 22, while a dynamic import() of the same file without the attribute throws ERR_IMPORT_ATTRIBUTE_MISSING. Add the attribute to every JSON import, static or dynamic. Node 22 refuses the import without it.
