Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCRIPT1014: Invalid character error on IE #1839

Closed
TomiTakussaari opened this issue Aug 16, 2017 · 7 comments
Closed

SCRIPT1014: Invalid character error on IE #1839

TomiTakussaari opened this issue Aug 16, 2017 · 7 comments

Comments

@TomiTakussaari
Copy link
Contributor

Open https://www.gatsbyjs.org/ or https://op-developer.fi on IE10 or IE11, and you get this kind of error to console, with unfortunate effect of disabling rest of javascript on site:

(I am using Windows 10 & IE11 on Browserstack)

screen shot 2017-08-17 at 0 02 04

screen shot 2017-08-17 at 0 02 13

https://op-developer.fi is using Gatsby 1.6.6, but same problem seems to be with Gatsby 1.8.11 too.
Pre 1.0 versions of Gatsby did seem to work though.

Looking at IE debug tools, it kind of looks like it happens because of backtick usage in loaders/gatsby-module-loader/patch.js, but would have though that Babel would convert those.

Also some Gatsby sites seem to work fine, or atleast better, on IE, so not really sure what is going on.

Should Gatsby even still work with IE's ?

@TomiTakussaari
Copy link
Contributor Author

Funny thing is, if I test with IE11 locally, running gatsby develop, everything works just fine and there are no errors.

@TomiTakussaari
Copy link
Contributor Author

After replacing backticks on patch.js with double quotes ("), I got different error:

screen shot 2017-08-17 at 1 24 30

screen shot 2017-08-17 at 1 24 50

I guess that's enough for today then, no idea how that could work in other browsers, but fail on IE.

@TomiTakussaari
Copy link
Contributor Author

Reverting back to Gatsby 1.5.0 fixed this issue for me.

@KyleAMathews
Copy link
Contributor

Lemme know if the latest release with #1901 fixes things!

@TomiTakussaari
Copy link
Contributor Author

#1901 fixed the original error, and for example https://www.gatsbyjs.org/ now seems to work fine on IE, thanks!

But on my site i now get this same error I reported in #1839 (comment).

screen shot 2017-08-25 at 11 25 29

Apparently it has something to do with my code, because it does not happen universally, but I have no idea what could cause it only on IE & IOS7 Safari.

Gatsby 1.5.0 is free of this issue as well.

@KyleAMathews
Copy link
Contributor

hey progress!

On your error — best way forward is if you can recreate the error in a small reproduction site. Copy your site and try stripping away everything until you have the smallest site possible that still creates the bug. I can look at it then.

@TomiTakussaari
Copy link
Contributor Author

Ok, so apparently this latest "Unable to get property pathname of undefined or null reference" was because babel-polyfill was imported in gatsby-browser.js, and not in gatsby-node.js/modifyWebpackConfig.

So importing it via gatsby-browser.js worked for some reason until gatsby 1.5, but with later versions it needs to be added via modifyWebpack.

So I guess this is solved by that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants