Skip to content

[Bug]: PnP linker does not work with docusaurus #4086

@alubbe

Description

@alubbe

Self-service

  • I'd be willing to implement a fix

Describe the bug

Using the PnP linker with docusaurus (specifically, running yarn build) leads to this error:

[ERROR] The image at yarn2-docusaurus-bug/static/img/docusaurus.png can't be read correctly. Please ensure it's a valid image.
The "path" argument must be of type string. Received type number (27)

Setting nodeLinker: node-modules fixes everything.

To reproduce

Clone https://github.com/alubbe/yarn2-docusaurus-bug, run yarn install followed by yarn build to see the errors.

Then set nodeLinker: node-modules (or revert the current commit), run yarn install followed by yarn build to see that it all works again.

This repo was created by simply running npx create-docusaurus@latest my-website classic.

Environment

System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 16.13.2 - /private/var/folders/3q/__zqxvrj0pqdmv03_3hkknl00000gn/T/xfs-c06aa74c/node
    Yarn: 3.1.1 - /private/var/folders/3q/__zqxvrj0pqdmv03_3hkknl00000gn/T/xfs-c06aa74c/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupholdedReal issues without formal reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions