I have a custom html.js in the root of the src directory for a theme I have created.
However this is not being built in a site that consumes the theme. The html.js file seems to be completely ignored.
html.js to the theme using the steps found heredevelop or build. You will see that customisations are not coming through.The html.js file in the theme should be read and built.
The html.js file is ignored in the theme.
System:
OS: macOS 10.15
CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.1 - ~/.nvm/versions/node/v10.16.1/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.10.2 - ~/.nvm/versions/node/v10.16.1/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 78.0.3904.70
Safari: 13.0.2
npmGlobalPackages:
gatsby-dev-cli: 2.5.7
Thank you for opening this!
I wouldn't count this as a bug as using html.js is already a workaround solution for people who don't want to use the appropriate APIs. You should use onRenderBody for example instead. Therefore I'd say this is a "nofix" from our site as you are able to achieve your desired behaviors with our APIs.
We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!
Hey @LekoArts the solution of onRenderHTML is the one I went with in the end.
I think it's probably worth mentioning this in the article I linked to in the initial description to clear this up for other developers of themes.
Happy to pick this up if it is not mentioned elsewhere in the documentation?
Sure, go ahead!