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.

Gatsby site not rendering in IE 11

See original GitHub issue

I’ve created a new site using the https://github.com/codebushi/gatsby-starter-photon template, and I’ve upgraded to the latest version of Node.js (12.16.1) and the latest Gatsby (2.20.1), but I can’t get the site to render in IE or the original Edge browsers. I’ve tried a ton of things I’ve found on the net, and I’m injecting polyfill.js as well. In fact, I’ve tried injecting another polyfill directly into the system to support “forEach”, but I’m still getting a blank page, and the following error:

Object doesn't support property or method 'forEach'

Can anyone help with this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
HiltonGiesenowcommented, Mar 22, 2020

ah, I figured it out - I wasn’t using the browser tools correctly to track the error stack - now I see where the forEach is that’s giving the trouble! It was in my TopNav.js, so I’ve just replaced:

		document.querySelectorAll(".navbar li").forEach(function (elem) { 
            elem.onclick = function() {
                document.getElementById("topnav").classList.remove("open");
            };
        });

with

var liElements = document.querySelectorAll(".navbar li");
		for (let i = 0; i < liElements.length; i++) {
			const elem = liElements[i];
			
			elem.onclick = function() {
                document.getElementById("topnav").classList.remove("open");
            };
		}

and now it’s working perfectly - thanks so much for the help tracking this down! I’ll look more into the docz site now, with this knowledge

0reactions
HiltonGiesenowcommented, Mar 22, 2020

I got it working for Docz as well, albeit with some ugliness, in case it can help others. Posted here: https://github.com/doczjs/docz/issues/1428

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby site not rendering in IE 11 - Stack Overflow
Incidentally, I've got this with a "normal" gatsby site and the same with a Docz site - neither is working in IE 11,...
Read more >
How to get Gatsby to work in Internet Explorer 11
I found myself working on a volunteer project using Gatsby, a really great wrapper around React.js that incorporates server-side rendering ...
Read more >
Browser Support | Gatsby
Gatsby supports the same browsers as the current stable version of React.js which is currently Edge, Firefox, Chrome, Safari, as well as…
Read more >
Make Gatsby Application compatible with IE11 Browser
This page will describe the challenges faced to make the Gatsby Application compatible with IE11 and how we have solved them.
Read more >
Gatsby Changelog | 5.3.0
Install gatsby@next and let us know if you have any issues. ... one-ness: chore(docs): Add IE 11 note to v2 to v3 migration...
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