-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby ignores custom html.js and static files #3308
Comments
https://www.gatsbyjs.org/docs/adding-images-fonts-files/#using-the-static-folder |
Hello Kyle, thanks for the fast response. My html.js file is located in the src folder, but it sill gets ignored. |
You have to restart the develop server as well if you haven't. |
I did. I even deleted the .cache and, to be super safe, the public folder. |
Could you make a reproduction site? Hard to know why this would be failing without seeing sample code. Lots of people are using custom html.js components. |
i'm also having the same issue. my package.json has these deps:
and html.js is inside src folder. I also tried building and no difference. also no changes to any of the gatsby js files. only config has: |
I created simple gatsby site from gatsby-cli and putting html.js into src doesn't work. |
@themre check if there's any errors in the console. Lots of people use custom html.js files (including gatsbyjs.org) so we know it works. |
There is no error, everything goes through normally. I also put console.log in static-entry and develop-static-entry.js to see if it gets html, but still no output. If you can point me where to look, I can look further. |
even stranger is if I change default-html.js in .cache folder, it isn't modified, regardless if I run develop or build. Perhaps this is a Windows only issue? Because I also noticed that paths behave strange when I run build. JS src is e.g. |
@themre it sounds like there's something strange going on there. Could you push up an example repo to look at? |
@m-allanson i've setup clean gatsby site by only running |
@themre your |
ok, that I get it but what about this one? |
For now I have solved this by adding script to react-helmet: |
Hello!
I have a strange issue. I tried to modify the hmtl.js file.
I copied over to src/html.js and added my code (I try to get outdatebrowser into the build http://outdatedbrowser.com/en/).
But Gatsby seems to ignore the file. The custom code doesn't appear in the header and body.
Maybe a related issue I have as well is that Gatsby is not copying over my static files from src/static to the public folder (for example a video in src/static/videos/vid1.mp4). Is this a known issue or do I do something wrong?
Cheers,
Dominik from rocket.works
The text was updated successfully, but these errors were encountered: