question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Window is not available on static site generators.

See original GitHub issue

Description

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.

📈 Running Site

👨‍💻 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
richardwestenracommented, Mar 9, 2020

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.

0reactions
richardwestenracommented, Mar 12, 2020

@WaylonWalker this should now be fixed on the develop branch, and will be fixed in the upcoming release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: 'window is not defined' with Webpack 4 #130 - GitHub
window }), I came up with this idea. Now I face ERROR in SecurityError: localStorage is not available for opaque origins also from...
Read more >
Gatsby - the window is not defined error, what and how to fix it?
Gatsby is one of the most popular Static Site Generators available to create pre-built markups for Jamstack apps.
Read more >
The 14 Best Static Site Generators You May Not Have Heard ...
Let's take a closer look at some of the advantages of using a static site generator. Jamstack-ready. Jamstack (JavaScript, APIs, and Markup) is ......
Read more >
Static Site Generators - Top Open Source SSGs - Jamstack
Check out this showcase of some of the best, open source static site generators. This is community-drive so be sure to submit your...
Read more >
Static site generators - O'Reilly
Before we dig into static site generators, there's one last item we need to discuss: ... Jekyll is not officially supported on Windows....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found