You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added this package to Gatsby.js React project.
when running "gatsby develop" CLI, site works fine. script loads in what is needed.
But when trying to create production build, "gatsby build" the build fails because scriptjs tries to execute since it thinks it is in browse environment meanwhile it is not yet. The link below explain the situation better. So if you can update your code to only run when "document" is available would be great.
In the meantime I am using method b) by placing the code in componentDidMount(), which is working for me.
Reacted by Hein Haraldson Berg, Dallon Feldner, Samuel Vaillant, Monisha, Marvin Arnold, Hung Le, lisez, vladimir1980, Tommi Lehto, Dmytro.D and 16 more
Activity
necheporenko commentedon Jul 12, 2019
The same error...
JJCLane commentedon Jun 15, 2020
I've created a fork with the necessary fix if it helps anyone. JJCLane@5718da9