Emotion: Can't run app after upgrade to Emotion 10, using Theming

Created on 3 Dec 2018  路  1Comment  路  Source: emotion-js/emotion

  • emotion version: 10.0.1
  • react version: 16.6.3

What you did:
I upgraded Emotion to 10.0.1

What happened:
I was upgrading from react-emotion 9 to emotion 10.

The only things I'm using from emotion are:

  • styled
  • keyframes
  • ThemeProvider
  • withTheme

I updated all references to styled and keyframes - changing their imports to @emotion/styled and @emotion/core respectively. I didn't make any changes to how ThemeProvider or withTheme is imported, as it didn't seem to call for it anywhere I looked.

I deleted node_modules, and re-installed.

On NPM start, my app never runs - failing with:

./node_modules/emotion-theming/dist/emotion-theming.browser.esm.js
Attempted import error: 'ThemeContext' is not exported from '@emotion/core'

I don't use ThemeContext anywhere in my application

Most helpful comment

For anyone who might run into the same issue, this was because my primary emotion package was still "emotion" and not "@emotion/core" in my package.json file.

>All comments

For anyone who might run into the same issue, this was because my primary emotion package was still "emotion" and not "@emotion/core" in my package.json file.

Was this page helpful?
0 / 5 - 0 ratings