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

IE11: Object not valid as React Child #14922

Closed
thomascorthouts opened this issue Jun 19, 2019 · 12 comments
Closed

IE11: Object not valid as React Child #14922

thomascorthouts opened this issue Jun 19, 2019 · 12 comments
Assignees
Labels
help wanted Issue with a clear description that the community can help with. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@thomascorthouts
Copy link
Contributor

thomascorthouts commented Jun 19, 2019

Description

Since a few weeks, we get more and more errors from IE11 users, the error messages are Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}) (similar to #7003, so sorry if it should have been re-opened instead)

Few things I've found so far (trying to fix it):

  • The error seems to be introduced starting from Gatsby v2.8.0
  • The error while developing (I mean gatsby develop) is Promise is ‘undefined’ (-> possibly there is a new promise introduced that isn't being polyfilled)

I would like to help tackle this issue, but I could use some help to start 😅

Steps to reproduce

Visit https://www.gatsbyjs.org/ in IE11 and look at the console.

Expected result

IE11 users should be able to use a regular Gatsby website.

Actual result

The website breaks for them and React throws an error
Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner})

Environment

  System:
    OS: macOS 10.14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/local/bin/python
  Browsers:
    Chrome: 74.0.3729.169
    Safari: 12.1.1
  npmPackages:
    gatsby: ^2.9.9 => 2.9.11
    gatsby-image: ^2.1.4 => 2.1.4
    gatsby-plugin-emotion: ^4.0.6 => 4.0.7
    gatsby-plugin-portal: ^1.0.7 => 1.0.7
    gatsby-plugin-purgecss: ^4.0.0 => 4.0.0
    gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12
    gatsby-plugin-react-svg: ^2.1.1 => 2.1.1
    gatsby-plugin-sass: ^2.0.11 => 2.0.11
    gatsby-plugin-sentry: ^1.0.1 => 1.0.1
    gatsby-plugin-sharp: ^2.1.7 => 2.1.7
    gatsby-source-apiserver: ^2.1.2 => 2.1.2
    gatsby-source-filesystem: ^2.0.41 => 2.0.41
    gatsby-source-graphql: ^2.0.19 => 2.0.19
    gatsby-transformer-sharp: ^2.1.21 => 2.1.21
    gatsby-transformer-yaml: ^2.1.12 => 2.1.12
  npmGlobalPackages:
    gatsby-cli: 2.6.13
@wardpeet wardpeet self-assigned this Jun 20, 2019
@thomascorthouts
Copy link
Contributor Author

@wardpeet let me know if there is something I can do

@wardpeet
Copy link
Contributor

It has been a busy week so thank you for your patience. I have it on my schedule for today.

@thomascorthouts
Copy link
Contributor Author

No worries, I can imagine! It's more of a "happy to contribute, if it would help" 😄

@matthieuauger
Copy link
Contributor

Hello, the "promise" error seen in development mode is also referenced here : #14502

@wardpeet
Copy link
Contributor

seems like hot reloading being the culprit. We can add the core-js/library/es6/promise before loading hot reloading to get this fixed.

commons: [
require.resolve(`event-source-polyfill`),
`${require.resolve(
`webpack-hot-middleware/client`
)}?path=${getHmrPath()}`,
directoryPath(`.cache/app`),
],

@wardpeet wardpeet added help wanted Issue with a clear description that the community can help with. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby labels Jun 26, 2019
@thomascorthouts
Copy link
Contributor Author

@wardpeet Thanks, that could indeed be the resolution for the develop issue.
But we also get an error on production builds, being: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}) :/ I assumed they were one and the same error, but it might be the case that they aren't...

@wardpeet
Copy link
Contributor

Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner})

seems like something else. Can you try running it in develop and get us the unminified error?

@thomascorthouts
Copy link
Contributor Author

Yeah, I'll give it a try! I get the same on https://www.gatsbyjs.org/blog:
Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%2C%20_owner%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

I'll try to get it before the maintainer meeting

@thomascorthouts
Copy link
Contributor Author

Interesting, in gatsby develop the error I get is:
Syntax Error File: commons.js, Line: 47228, Column: 16
which is
return key => (result, value) => {

so it seems like some missing polyfill in general

@thomascorthouts
Copy link
Contributor Author

thomascorthouts commented Jul 5, 2019

This seems to be fixed in the newer versions of Gatsby, so I'm going to close it for now. Thanks @wardpeet and others for fixing and contributing!

@glueCod
Copy link

glueCod commented Apr 23, 2020

@thomascorthouts if you could solve your issue with Gatsby and ie11 please share how is the approach, currently i am facing with this issue. IE11 renders a blank page with error common.js and Navigation occured.

@hohler
Copy link

hohler commented May 4, 2020

@thomascorthouts I have the same issue, just updated to Gatsby 2.21.10 but I still get that error in commons.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

5 participants