0

Pulled a snippet out of my passion project because I cannot figure out why this file can't be found when running locally (Gatsby). Why is that not a valid path? My tsv file is in the same directory as the calling file. The tsv has 3 columns: time, stock, index

In the real project, useMarketData.js contains this snippet and the tsv and this file are both in src/

enter image description here

enter image description here

9
  • What do you mean by "running locally"? file: protocol? Commented Mar 23, 2024 at 22:37
  • Gatsby develop and pulling up localhost Commented Mar 23, 2024 at 22:43
  • Your code should work from what I see. Do you point to ./src/script.js in the HTML? Commented Mar 23, 2024 at 22:46
  • updated with another screenshot and additional info. yes its pointing to it Commented Mar 23, 2024 at 22:59
  • Pictures don't really help. You are getting a 404 error where the URL that causes the 404 does not contain "src". Commented Mar 23, 2024 at 23:01

1 Answer 1

1

You need to put the tsv file inside the static folder. Read the gatsby documentation for more details.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.