Emotion versioning
See original GitHub issueBug Report
Emotion version seems to be inconsistent
I’m getting import errors in npm around @emotion/, specifically some referenced classes. @emotion/core and @emotion/styled seem to be pulling incompatible versions. I don’t see a peer dependency for emotion in the docs but adding v10.0.5 of @emotion/core and @emotion/styled seems to fix the problem.
Perhaps I’m just missing the part of the docs or package.json where it’s a peer dependency?
To Reproduce
- Delete
package-lock.json
andnode_modules
npm i docz docz-theme-default
npm run docz:dev
The import errors I’m seeing without @emotion as a dependency:
./node_modules/docz-theme-default/dist/index.m.js
Attempted import error: 'ClassNames' is not exported from '@emotion/core'.
./node_modules/emotion-theming/dist/emotion-theming.browser.esm.js
Attempted import error: 'ThemeContext' is not exported from '@emotion/core'.
./node_modules/emotion-theming/dist/emotion-theming.browser.esm.js
Attempted import error: 'ThemeContext' is not exported from '@emotion/core'.
./node_modules/emotion-theming/dist/emotion-theming.browser.esm.js
Attempted import error: 'ThemeContext' is not exported from '@emotion/core'.
The warnings when I have emotion/core and emotion/styled as depdencies:
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @emotion/styled-base@0.10.6 requires a peer of @emotion/core@0.x.x but none is installed. You must install peer dependencies yourself.
npm WARN @emotion/styled-base@0.10.6 requires a peer of @emotion/core@0.x.x but none is installed. You must install peer dependencies yourself.
npm WARN @emotion/styled-base@0.10.6 requires a peer of @emotion/core@0.x.x but none is installed. You must install peer dependencies yourself.
npm WARN react-docgen-typescript-loader@2.2.0 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN @emotion/provider@0.11.2 requires a peer of @emotion/core@0.x.x but none is installed. Youmust install peer dependencies yourself.
npm WARN react-treebeard@3.1.0 requires a peer of @emotion/styled@^0.10.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-docgen-typescript-loader@3.0.0 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
The documentation is compiled successfully with these warnings.
Expected behavior
Should emotion be documented as a peer dependency?
Environment
- OS: OSX 10.14.1
- Node/npm version: Node 10.13.0/npm 6.5.0
- docz / docz-theme-default: ^0.13.2
Additional context/Screenshots
Forgive me if this is off base…
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:11
Top GitHub Comments
In my project and docz v0.13.7, this error still prevents updating modules and
yarn.lock
. Clearing node_modules and yarn.lock, or installing@emotion/cache
, or using npm instead of yarn doesn’t work.Agreed! Don’t know why
@emotion/cache
needs to be installed.