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

Newly created project doesn't start #8688

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

Newly created project doesn't start #8688

Tandashi opened this issue Feb 20, 2023 · 4 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.

Comments

@Tandashi
Copy link

Tandashi 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

Creating a new project and then running it does not work as expected.

Also: I am not the only one with that Issue. Currently, 3+ people in the Discord also mentioned to have that exact problem.

PS: CodeSandback seems to work because it uses cached dependencies
(Using the yarn.lock and installing with yarn install --force --pure-lockfile works. Looks like a dependency issue)

Reproducible demo

No response

Steps to reproduce

npx create-docusaurus@latest my-website classic --typescript

# cd into the directory

npm run start

Expected behavior

Seeing the template wiki without a problem

Actual behavior

Seeing the following error
image

Your environment

  • Docusaurus version used: 2.3.1
  • Environment: Latest Vivaldi (5.7.2921.53) & Nodejs 19.5.0 (also tested with 18.14.0)
  • Operating system: MacOS Catalina

Self-service

  • I'd be willing to fix this bug myself.
@Tandashi Tandashi 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
@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Feb 20, 2023

Thanks for reporting. This is an upstream issue: babel/babel#15444 In the meantime, try installing the exact version via resolutions or some other mechanism.

@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 external This issue is caused by an external dependency and not Docusaurus. bug An error in the Docusaurus core causing instability or issues with its execution and removed 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
@zph
Copy link

zph commented Feb 20, 2023

The resolution @Josh-Cena mentioned in meantime that works:

Set back the babel/generator version to 7.20.0 from 7.21.0 in package.json

{
  "name": "website",
  "version": "0.0.0",
  "private": true,
  "overrides": {
    "@babel/generator": "7.20.0"
  },
....
}

@CalvinWilkinson
Copy link

@zph Thanks for the workaround but I have been running into some issues, which are probably my fault.

I went into the JSON file and added the overrides section into the package.json file. After that, I deleted the package-lock.json, deleted the node_modules folder, and then ran the following commands.

  1. yarn install

    Note I also tried the command yarn install --force --pure-lockfile

  2. yarn start

I still get the same issue. I am sure that I am missing something but I don't know what it is.
Could you possibly assistance me with this workaround?

@syncimprov
Copy link

@CalvinWilkinson - the overrides block works if you are using npm. If you are using yarn, use the resolutions block:

 "resolutions": {
    "@babel/generator": "7.20.0"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
Development

No branches or pull requests

5 participants