I'm facing these issues in angular 12 version, I'm unable to connect the JSON file
-
2What issues? Please add them to the body of your question.BritishWerewolf– BritishWerewolf2021-05-24 15:48:27 +00:00Commented May 24, 2021 at 15:48
-
Should this be tagged [angular] instead of [angularjs] since it isn't AnglarJS 1.x related?Jerry Jeremiah– Jerry Jeremiah2021-07-12 03:09:49 +00:00Commented Jul 12, 2021 at 3:09
Add a comment
|
2 Answers
Place the below setting into compilerOptions of tsconfig.json. See the example here
"resolveJsonModule": true,
"esModuleInterop": true,
1 Comment
Audiopolis
Still getting the same error, even with this in both
tsconfig.json and tsconfig.vite.json, using Vite.create a file named "json-typings.d.ts" in your app directory and paste the code below.
declare module "*.json" {
const value: any;
export default value;
}
1 Comment
Community
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.