Module not found: Can't resolve 'emotion' after upgrading to emotion 10.0
See original GitHub issueBug Report
Describe the bug After upgrading my project and components to use the newest version of emotion, i get the following error when i try to run docz
./src/App/UI/components/PanelTabs/PanelTabs.js Module not found: Can't resolve 'emotion' in '/Users/bringel/source/snowdrop-web/src/App/UI/components/PanelTabs'
That file doesn’t try to import anything from emotion
. Its emotion imports look like this:
import { css, jsx } from '@emotion/core';
import styled from '@emotion/styled';
To Reproduce
Upgrade to emotion 10 Run docz:dev
In order to allow us to quickly reproduce you issue please include a link to a reproduction repository.
Expected behavior
A clear and concise description of what you expected to happen…
Environment
- OS: OS X 10.14
- Node/npm version: Node 11.1 npm 6.4.1 yarn 1.10.1
- docz 0.13.7
- @emotion/core 10.0.5
Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9
Top GitHub Comments
install this “npm i @emotion/styled @emotion/core”
emotions docs (https://5faaafd0bd0f3f0008469537--emotion.netlify.app/docs/introduction)
I had the same error after upgrading from emotion 9 to emotion 10 (not using docz though). Turned out I forgot to also update
babel-plugin-emotion
. Upgrading this fixed the issue for me. Hope this helps others who stumble on this issue.