styled-components icon indicating copy to clipboard operation
styled-components copied to clipboard

Uncaught Error: An error occurred. See https://github.com/styled-components/styled-components/blob/master/src/utils/errors.md#1 for more information. Additional arguments: [object Object]

Open joetidee opened this issue 7 years ago • 4 comments

Installed v4.1.2 and am receiving the following error in chrome console:

Uncaught Error: An error occurred. See https://github.com/styled-components/styled-components/blob/master/src/utils/errors.md#1 for more information. Additional arguments: [object Object]

Obviously not a very helpful message :(

Environment

System:

  • OS: macOS High Sierra 10.13.1
  • CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
  • Memory: 62.50 MB / 8.00 GB
  • Shell: 3.2.57 - /bin/bash

Binaries:

  • Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
  • npm: 6.8.0 - ~/.nvm/versions/node/v8.11.1/bin/npm

joetidee avatar Feb 17 '19 17:02 joetidee

Same here, had to downgrade

Peterabsolon avatar Feb 22 '19 15:02 Peterabsolon

Make sure react-is is upgraded in your project to at least the same version # as react and react-dom

quantizor avatar Mar 21 '19 04:03 quantizor

I'm having this same problem on ie11.

We currently have the following polyfills:

import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';

some discussions on the same topic suggested we were missing import 'core-js';. Adding that throws our app into a frozen state we cant recover. Might not be related though... :/

relevant packages:

    "core-js": "^3.8.1",
    "react": "^17.0.1",
    "react-app-polyfill": "^2.0.0",
    "react-dom": "^17.0.1",
    "react-is": "^17.0.1",
    "react-scripts": "^4.0.1",
    "styled-components": "^5.2.1",

any ideas?

PupoSDC avatar Dec 13 '20 12:12 PupoSDC

I was facing this same issue as well! It was mainly happening on production build, and I was unable to reproduce the bug locally!! I found no solution after several hours googling. At the end, I was running the production build locally and discovered I had circular dependent styled component on my split(lazy-load) pages and when one page was loading it didn’t have reference to the exported styled component defined on another page. It works locally because we have webpack running. So the best practice is to move the styled components to a separate un-split file. Try not to export a styled component from a split page that needed reference on another page.

DebOM avatar Jul 16 '21 16:07 DebOM