Docz: Getting started flow is very buggy

Created on 10 Jan 2019  路  6Comments  路  Source: doczjs/docz

Bug Report

Describe the bug

The "Getting Started" process is super clunky and buggy.

The main issues is that you have to install a lot of dependencies by yourself (docz-theme-default and @emotion/core, for example), just to get it to run.

This is not a pure case of peerDependencies.

If docz requires these packages in order to run the very most basic setup, they should be installed as dependencies.

And just when you think you're done, another issue pops up and you have to scour the web/issues page for solutions, which often seem hacky (https://github.com/pedronauck/docz/issues/522 for example).

Besides that, the documentation doesn't specify any of this, and it's impossible to follow it step by step without running into these issues.

To Reproduce

  1. Install the latest version of docz (0.13.7 for example).
  2. Run docz dev through an npm script.
  3. See error.

This is just the latest error where I gave up:

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

This is the before installing @emotion/core myself:

./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'.

Expected behavior

Pretty straightforward:

  • Up-to-date documentation.
  • A package should install its dependencies.

Environment

  • OS: MacOS
  • Node/npm version: Node 8.9.0, npm 6.5.0.

Most helpful comment

I'm getting this problem today. I did try everything, included create a new project, but always is getting this warning and the project is not loading.

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

I'm using CRA but not using storybook. So i don't see what is the problem.

All 6 comments

True that. Very clunky start. But this lib is sooo good.
Babel config is another thing to consider, custom overrides may mess up compiled code with some obscure error messages, add that to all of the above.

@sahariko Do you happen to have storybook installed in the same project? I had the same issues, removing SB solved it.

@melMass
TL;DR - Yes, but I can't really remove it.

My package is inspired by CRA and provides core functionality (some of it via storybook) to consumers, but I don't use storybook myself.

That problem could actually be solved if docz would install its required modules itself, since npm would resolve the dependency tree correctly.

docs are 2 months out of date. i've filed PR's and just offered to help with maintaining. lets see if pedro accepts.

I'm getting this problem today. I did try everything, included create a new project, but always is getting this warning and the project is not loading.

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

I'm using CRA but not using storybook. So i don't see what is the problem.

hey friends i'm now helping out on the docz docs maintenance. please send PRs and open issues for specific updates to https://github.com/pedronauck/docz-website. i've merged in instructions to add docz-theme-default, lets deal with each other issue separately (for example, i dont use emotion and i dont have this issue at all, so likely this should be in a separate section for emotion)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

molebox picture molebox  路  40Comments

tadeuszwojcik picture tadeuszwojcik  路  30Comments

lorenzorapetti picture lorenzorapetti  路  31Comments

ivan-dalmet picture ivan-dalmet  路  83Comments

godmar picture godmar  路  24Comments