question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to install with Yarn 3: "Error: Assertion failed: Expected the root to be registered"

See original GitHub issue

I am using Yarn 3.1.1 and on a fresh Docusaurus install, yarn add docusaurus-preset-openapi yields this error:

Error: Assertion failed: Expected the root to be registered

To reproduce, put this pacakge.json in an empty directory and run yarn install && yarn add docusaurus-preset-openapi afterwards:

{
  "name": "my-package",
  "packageManager": "yarn@3.1.1",
  "dependencies": {
    "@docusaurus/core": "2.0.0-beta.14",
    "@docusaurus/preset-classic": "2.0.0-beta.14",
    "@mdx-js/react": "^1.6.21",
    "clsx": "^1.1.1",
    "prism-react-renderer": "^1.2.1",
    "react": "^17.0.1",
    "react-dom": "^17.0.1"
  }
}

However, it works fine with Yarn 1.22 (a version no longer under active development), if this line is removed:

  "packageManager": "yarn@3.1.1",

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JaimeObregoncommented, Dec 22, 2021

Thank you, @bourdakos1! With 2.0.0-beta.13 it does work wonderfully 👍.

1reaction
bourdakos1commented, Dec 22, 2021

I was able to get it to install using "@docusaurus/core": "2.0.0-beta.13":

{
  "name": "my-package",
  "packageManager": "yarn@3.1.1",
  "dependencies": {
    "@docusaurus/core": "2.0.0-beta.13",
    "@mdx-js/react": "^1.6.21",
    "clsx": "^1.1.1",
    "docusaurus-preset-openapi": "0.3.1",
    "prism-react-renderer": "^1.2.1",
    "react": "^17.0.1",
    "react-dom": "^17.0.1"
  }
}

I’m guess the issue is because we depend on "2.0.0-beta.13" internally?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expected the root to be registered when build docusaurus ...
YN0001: │ Error: Assertion failed: Expected the root to be registered at lUe (/Users/chenzili/.node/corepack/yarn/3.1.0/yarn.js:448:4565)
Read more >
Error Codes | Yarn - Package Manager
This error means that this process failed and Yarn cannot successfully figure out which version of the package should be added to your...
Read more >
Showing error in yarn start command says This package ...
Try running yarn install to install the required packages. If this does not work, try deleting the node_modules folder and run yarn install...
Read more >
Repository - GitLab
rootRequester);if(void 0===s)throw new Error("Assertion failed: Expected the root package to have been registered");const a=null!
Read more >
Node.js v19.3.0 Documentation
Running npm install -g yarn doesn't work ... Stability: 3 - Legacy. ... A subclass of Error that indicates the failure of an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found