Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
Trouble importing json file to .js file

I have a simple javascript file that's meant to fetch an object as a json file and display it in the console:

javascript code

When I run the page on my app, I get these error messages:

errors

As far as I can tell, my directories are set up fine and I don't think there are any typos in the code. I think the problem has something to do with not being able to find the json file. I've even tried putting the json file in the same folder as main.js but this hasn't worked either. This is how my directory is laid out anyway in case the error has something to do with that:

Directories

I'm making an app using Flask and ultimately want to be able to store the json object in a js variable so I can use d3 to make tree graphs with it.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!