payload icon indicating copy to clipboard operation
payload copied to clipboard

Bug Report: Workspace Dependencies Cause pnpm Install Failure

Open Docker-Hunterpedia opened this issue 1 year ago • 3 comments

Describe the Bug

The project's package.json contains workspace dependencies (workspace:*) but lacks the necessary workspace configuration, causing pnpm install to fail with ERR_PNPM_WORKSPACE_PKG_NOT_FOUND errors.

Link to the code that reproduces this issue

git clone -n --depth=1 --filter=tree:0 https://github.com/payloadcms/payload my-project && cd my-project && git sparse-checkout set --no-cone templates/ecommerce && git checkout && rm -rf .git && git init && git add . && git mv -f templates/ecommerce/{.,}* . && git add . && git commit -m "Initial commit"

Reproduction Steps

Bug Report: Workspace Dependencies Cause pnpm Install Failure

Description

The project's package.json contains workspace dependencies (workspace:*) but lacks the necessary workspace configuration, causing pnpm install to fail with ERR_PNPM_WORKSPACE_PKG_NOT_FOUND errors.

Error Message

Which area(s) are affected? (Select all that apply)

area: templates

Environment Info

### Expected Behavior
`pnpm install` should successfully install all dependencies without workspace-related errors.

### Actual Behavior
`pnpm install` fails with workspace dependency errors for all `@payloadcms/*` packages and the `payload` package.

### Root Cause
The `package.json` file contains dependencies specified as `workspace:*`:
- `@payloadcms/admin-bar`: "workspace:*"
- `@payloadcms/db-mongodb`: "workspace:*"
- `@payloadcms/email-nodemailer`: "workspace:*"
- `@payloadcms/live-preview-react`: "workspace:*"
- `@payloadcms/next`: "workspace:*"
- `@payloadcms/plugin-ecommerce`: "workspace:*"
- `@payloadcms/plugin-form-builder`: "workspace:*"
- `@payloadcms/plugin-seo`: "workspace:*"
- `@payloadcms/richtext-lexical`: "workspace:*"
- `@payloadcms/translations`: "workspace:*"
- `@payloadcms/ui`: "workspace:*"
- `payload`: "workspace:*"

However, there is no `pnpm-workspace.yaml` file to define the workspace structure, and these packages don't exist as local packages in the repository.

### Proposed Solution
Replace all `workspace:*` dependencies with actual version numbers from the npm registry:


{
  "dependencies": {
    "@payloadcms/admin-bar": "^3.58.0",
    "@payloadcms/db-mongodb": "^3.58.0",
    "@payloadcms/email-nodemailer": "^3.58.0",
    "@payloadcms/live-preview-react": "^3.58.0",
    "@payloadcms/next": "^3.58.0",
    "@payloadcms/plugin-ecommerce": "^3.58.0",
    "@payloadcms/plugin-form-builder": "^3.58.0",
    "@payloadcms/plugin-seo": "^3.58.0",
    "@payloadcms/richtext-lexical": "^3.58.0",
    "@payloadcms/translations": "^3.58.0",
    "@payloadcms/ui": "^3.58.0",
    "payload": "^3.58.0"
  }
}


### Additional Issues Found
- Peer dependency warnings for `@playwright/test` (expected ^1.51.1, found 1.50.0)
- Peer dependency warnings for `@types/node` (expected ^20.19.0 || >=22.12.0, found 22.5.4)

### Environment
- OS: Linux
- pnpm version: 10.17.1
- Node.js: (version from engines requirement: ^18.20.2 || >=20.9.0)

### Steps to Reproduce
1. Clone the repository
2. Run `pnpm install`
3. Observe the workspace dependency errors

### Impact
This prevents new users from setting up the project locally and blocks development workflow.

Docker-Hunterpedia avatar Oct 02 '25 12:10 Docker-Hunterpedia

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@latest -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

github-actions[bot] avatar Oct 02 '25 12:10 github-actions[bot]

🚀 This is included in version v3.63.0

github-actions[bot] avatar Nov 07 '25 15:11 github-actions[bot]

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Nov 15 '25 05:11 github-actions[bot]