docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

useScrollController called outside of ScrollControllerProvider in yarn PnP mode

Open smeng9 opened this issue 1 year ago • 2 comments

Describe the bug

Building the Template Repository project throws useScrollController called outside of ScrollControllerProvider

Expected behavior

The Template Repository should be built without a problem.

Current behavior

I can't build the Template Repository in my project setup.

Possible solution

I guess it is some dependency issue but not sure.

Steps to reproduce

  1. git clone https://github.com/PaloAltoNetworks/docusaurus-template-openapi-docs
  2. cd docusaurus-template-openapi-docs && yarn set version berry and set yarn to PnP mode by rm .yarnrc.yml or just change .yarnrc.yml's nodeLinker to pnp
  3. yarn install then add missing dependencies yarn add @docusaurus/theme-common @docusaurus/plugin-content-docs
  4. yarn docusaurus gen-api-docs all && yarn build

Screenshots

Screenshot 2024-09-05 at 1 31 58 PM

Context

I am not able to build the project using yarn PnP mode. I can still build the project using nodeLinker: node-modules in .yarnrc.yml . However that will take more space to store the package dependencies during development and CI release.

Your Environment

  • Version used: Docusaurus OpenAPI Docs 4.0.1, Docusaurus 3.5.2
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): Safari 17.5, node.js 20.10.0, yarn 4.4.1
  • Operating System and version (desktop or mobile): desktop macOS Sonoma 14.5
  • Link to your project: https://github.com/PaloAltoNetworks/docusaurus-template-openapi-docs

smeng9 avatar Sep 05 '24 20:09 smeng9

Hi @smeng9, I don't use pnp so not too familiar with the issue you're encountering. That said, I removed the yarn.lock file from the template just in case it was causing any conflicts.

sserrata avatar Sep 06 '24 14:09 sserrata

Even after removing yarn.lock file and performing a fresh install, the same issue happens during build stage in PnP mode.

smeng9 avatar Sep 06 '24 15:09 smeng9

Fixed in https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/pull/1019 after moving @docusaurus/theme-common to peerDependencies to deduplicate the package

smeng9 avatar Dec 14 '24 00:12 smeng9