Skip to content

Failed to resolve workspace dependency present in 'optimizeDeps.include' #10047

@tajo

Description

@tajo

Describe the bug

It seems that optimizeDeps.include is able to resolve only dependencies that are defined in the root workspace and its package.json. In other words, you can optimize deps only from a single workspace.

After opening the repro, you will see this warning:

Failed to resolve dependency: jquery, present in 'optimizeDeps.include'

while react gets optimized just fine because it's in the root workspace.

Expectation

optimizeDeps.include should work for all dependencies across multiple workspaces. If these deps can be later resolved and served by Vite anyway I don't see a reason why they couldn't be prebundled as well.

Reproduction

https://stackblitz.com/edit/node-whfueq?file=app%2Fpackage.json

System Info

Stackblitz

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions