Skip to content

Ghost Dependency Issue found in yarn pnp #3985

@agarwalvaibhav0211

Description

@agarwalvaibhav0211

Environment

Nitro version: nitro-nightly version 3.0.1-20260127-164246-ef01b092
Node: v22.15.0

Reproduction

N/A

Describe the bug

Error: nitro-nightly tried to access nitro, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.    

Required package: nitro (via "nitro/meta")
Required by: nitro-nightly@virtual 
Error: nitro-nightly tried to access defu, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.    

Required package: defu(via "defu")
Required by: nitro-nightly@virtual 

Additional context

https://github.com/nitrojs/nitro/blob/main/src/build/vite/plugin.ts#L22

https://github.com/nitrojs/nitro/blob/main/src/build/vite/plugin.ts#L24

These are the packages causing issues, and are not included in the dependencies.

Ideally defu should be added to the dependencies. Also, all the files under nitro package should be accessed using relative paths import, rather than module imports, since nightly will not be able to access nitro package

Logs

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