Window is not available on static site generators.
See original GitHub issueDescription
I am running the KedroViz
react component inside of a gatsby application. When doing so I get an error that window is not available. To resolve this I need to implement a componentDidMount
method, and only render KedroViz
after the component did mount.
Is it possible to check if window is available before using it? The Error came from config.js#L7, appears to me that it could check for window before using it.
Context
I am running KedroViz 3.2.0
, I believe that this is in all versions, and is not related to the new release.
👨💻 index.js
Actual Result
The error occurred in config.js#L7. Without understanding KedroViz
further I cannot say that it would not error on other windows. I do see 8 instances of window just by searching the repo.
👏 Thanks
Thanks for open sourcing everything and making such an amazing set of tools!!
Checklist
- Include labels so that we can categorise your issue
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Cheers! I’m actually going to reopen this issue because I think it’s worth fixing properly. I’ll contact the maintainer of
svg-crowbar
and see whether they can patch that code too.@WaylonWalker this should now be fixed on the
develop
branch, and will be fixed in the upcoming release.