• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

177
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 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error