Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brand new project fails to compile - throws errors #8689

Closed
6 of 7 tasks
fuzing opened this issue Feb 20, 2023 · 6 comments
Closed
6 of 7 tasks

Brand new project fails to compile - throws errors #8689

fuzing opened this issue Feb 20, 2023 · 6 comments
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@fuzing
Copy link

fuzing commented Feb 20, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Brand new project installed using nodejs v18.7.

Installation and subsequent commands:

npx create-docusaurus@latest <project-name> --typescript
cd <project-name>
npm start

Results in the following errors:

TypeError: /home/Projects/some-project/node_modules/@docusaurus/theme-common/lib/components/Details/index.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
TypeError: /home/Projects/some-project/node_modules/@docusaurus/theme-common/lib/index.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
TypeError: /home/Projects/some-project/node_modules/@docusaurus/theme-common/lib/internal.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
TypeError: /home/Projects/fsome-project/node_modules/@docusaurus/utils-common/lib/index.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
client (webpack 5.75.0) compiled with 4 errors

Reproducible demo

No response

Steps to reproduce

npx create-docusaurus@latest <project-name> --typescript
cd <project-name>
npm start

Expected behavior

Per installation/getting started docs, this should work

Actual behavior

Throws errors:

TypeError: /home/Projects/some-project/node_modules/@docusaurus/theme-common/lib/components/Details/index.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
TypeError: /home/Projects/some-project/node_modules/@docusaurus/theme-common/lib/index.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
TypeError: /home/Projects/some-project/node_modules/@docusaurus/theme-common/lib/internal.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
TypeError: /home/Projects/fsome-project/node_modules/@docusaurus/utils-common/lib/index.js: Cannot read properties of undefined (reading '0')
    at run.next (<anonymous>)
    at transform.next (<anonymous>)
client (webpack 5.75.0) compiled with 4 errors

Your environment

  • Public source code: development/private right now
  • Public site URL: development/private right now
  • Docusaurus version used: 2.3.1 (latest)
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Ubuntu 22.04 LTS

Self-service

  • I'd be willing to fix this bug myself.
@fuzing fuzing added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Feb 20, 2023
@andysm1th
Copy link

I am also experiencing this same problem

@andysm1th
Copy link

This also happens when not using Typescript, so:

npx create-docusaurus@latest docusaurus-test classic

I am using Node v18.14.0

I've also tried with the pnpm and yarn package managers, they return the same error as posted above by fuzing.

@fuzing
Copy link
Author

fuzing commented Feb 20, 2023

ditto - tried with yarn and pnpm - same result. Folks using the discord channel seeing the same thing.

@zph
Copy link

zph commented Feb 20, 2023

I'm seeing the same outcome in the following new scenarios:

  1. node v19.6.0
  2. node v18.14.0
  3. Installation failed in same way using npx create-docusaurus@latest my-website classic (after the desired project name failed to work), with and without the typescript flag

@Tandashi
Copy link

Tandashi commented Feb 20, 2023

For Reference / Duplicate of #8688
Also describes a workaround for the meantime

Using the yarn.lock(https://codesandbox.io/p/sandbox/github/facebook/docusaurus/tree/main/examples/classic?file=%2Fyarn.lock) and installing with yarn install --force --pure-lockfile works. Looks like a dependency issue

@Josh-Cena
Copy link
Collaborator

I'm going to close this as a duplicate of #8688

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs triage This issue has not been triaged by maintainers bug An error in the Docusaurus core causing instability or issues with its execution labels Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

5 participants