Linked Questions

0 votes
1 answer
4k views

After trying to use json-loader with no success, I cant load an array of JSON into my react code, using webpack 1.4 and babel, if that makes a difference. import data from '../data/item-types.json'; ...
Storm's user avatar
  • 397
0 votes
1 answer
2k views

I have a simple project like this and have already install axios: The project In main.js,I tried to import the axios and a json file but throw error: import axios from 'axios' //SyntaxError: Cannot ...
Ricardo Paul's user avatar
397 votes
24 answers
587k views

How can I access a JSON file in ECMAScript 6? The following doesn't work: import config from '../config.json' This works fine if I try to import a JavaScript file. https://www.stefanjudis.com/...
Nikita Jajodia's user avatar
184 votes
15 answers
420k views

I'm new to React and I'm trying to import a JSON DATA variable from an external file. I'm getting the following error: Cannot find module "./customData.json" Could some one help me? It works if I ...
Hugo Seleiro's user avatar
  • 2,667
55 votes
6 answers
47k views

The typescript compiler works fine when I import a json file using const tasks = require('./tasks.json') However, when I run tsc, the output directory does not contain no tasks.json file, causing a ...
aherve's user avatar
  • 4,120
2 votes
4 answers
16k views

I am trying to load static JSON data to my react app. But, it wan't allow me to load data. I am using webpack version 4.26.1 It shows me following error: SyntaxError: src/data/movieData.json: ...
ketan's user avatar
  • 19.4k
1 vote
3 answers
4k views

I am unable to get the data from a json file in React.js I have checked myJSON on JSLINT and use a Windows system. Am not trying to display it yet just storing in a variable, it is still throwing an ...
Assasin_ng's user avatar
3 votes
1 answer
7k views

I've been looking for how to solve this error but i didn't understand very well how t fix it. I'm working with lottie-web on a project and i have to set the params of the animation on an object to ...
Carlos Pisarello's user avatar
0 votes
1 answer
2k views

I am following a react tutorial by Brian holt and i need to import .json file inside my react component like this : code When I try to build my project i was getting ERROR in ./data.json Module ...
Ma'mun 's user avatar
0 votes
1 answer
3k views

I have another react newbie question, I am trying to load some json data from an external, local, file called intro.json But I am getting the error default.map is not a function. Any ideas on what I ...
Ash's user avatar
  • 347
0 votes
1 answer
111 views

I have an app that fetch JSON data from a DB JSON and I want to paginate this data like for an example to show 1 image per page. How can I do it? Here is my DB JSON db.json file: "interiores": [ { ...
claudiopb's user avatar
  • 1,094
0 votes
1 answer
84 views

I have a UScsvjson.json file which contains covid cases from a start date to an end date for every county for every US state. This is how it looks (for the most part) [ { "UID": ...
zzzz's user avatar
  • 77