Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension
snippet in javascript

Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension

user9336

add to tsconfig.json

{
	...
    "resolveJsonModule": true
  }
}

how to import a json string from a file in typescript

user3225

import {default as a} from "a.json";
a.primaryMain