#1735·docz

Multiple errors after installing docz

Author: lauraceconiCreated Jun 24, 2022Updated Jan 22, 2025

Bug Report

Describe the bug

I'm getting multiple errors when following the installation and run instructions in docz documentation.

To Reproduce

  1. Inside an empty folder, run yarn add docz react react-dom
  2. Once the install is finished, add the following scripts to you package.json:
"scripts": {
    "docz:dev": "docz dev",
    "docz:build": "docz build",
    "docz:serve": "docz build && docz serve"
  }
  1. Run yarn docz:dev
  2. See the first error Error: Cannot find module 'typescript'
  3. Install Typescript: yarn add typescript
  4. Run yarn docz:dev again
  5. See error Can't resolve '@emotion/core' in...
  6. Install emotion: yarn add @emotion/core
  7. Run yarn docz:dev again
  8. More errors: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module image

image

Expected behavior

To run yarn docz:dev and yarn docz:serve without errors.

Environment

  • docz version: 2.4.0
  • OS: OSX 12.3.1
  • Node/npm version: Node v14.18.3/npm 6.14.15