Gatsby build : files not found / Failed to load resource | Double Marvellous
Back to Blog
Development Oct 14, 2024 4 min read

Gatsby build : files not found / Failed to load resource

Gatsby build : files not found / Failed to load resource

When you’re in development, everything is great. But after running gatsby build, your js plugins and fonts are all broken or missing

So to fix this, first run

gatsby clean

Then, go to your gatsby-config.js file, and add the location of a server where you will be accessing the site. You can edit it later, but for testing purposes, add a test site on a hosting location or a wamp folder location or something. Just some server location where you can browse to and test the site.

At the top of the module.exports, add pathPrefix: /your-location/,

This would be the folder where you are going to be testing your site…do not include the domain. It needs to be relative to the domain

Save your gatsby-config.js file. Then run:

gatsby build –prefix-paths

And your site will build as normal, but all the files will be correctly pointing where they need to once you upload the contents of the public folder to the https://yourmagicdomain.com/storage/yoursite/ folder

Double Marvellous

AI Chatbot

Double Marvellous.