Skip to content

fix: hoisting of dependencies after resolution stage#9686

Merged
zkochan merged 3 commits intomainfrom
fix/9685
Jun 24, 2025
Merged

fix: hoisting of dependencies after resolution stage#9686
zkochan merged 3 commits intomainfrom
fix/9685

Conversation

@zkochan
Copy link
Member

@zkochan zkochan commented Jun 24, 2025

close #9685

@zkochan
Copy link
Member Author

zkochan commented Jun 24, 2025

Tested on the example provided in the issue. Couldn't figure out yet how to test on a smaller project. I might merge it without a test for now to fix the regression.

@zkochan zkochan changed the title fix: hoisting fix: hoisting of dependencies after resolution stage Jun 24, 2025
@zkochan zkochan merged commit cc6db88 into main Jun 24, 2025
12 checks passed
@zkochan zkochan deleted the fix/9685 branch June 24, 2025 09:51
@LouisHaftmann
Copy link

I'm still facing the same issue as #9685 when using pnpm fetch (minimal repro)

It's missing a dependency when calling pnpm fetch before pnpm install. Works with version 10.12.1, fails with >=10.12.2

@zkochan

@omar-infinitusai
Copy link

I'm running into what I believe is a similar issue to #9685 when building my application with vite using pnpm >=10.12.2.

In this example below, a package in my pnpm workspace has @react-dnd/invariant as a dependency because one of my package's dependencies did not add it as a peer dependency. This was working up until the changes made in 10.12.2. now I have to use vite's build.rollupOptions.external option to get it to build.

> vite build

vite v6.3.5 building for production...

# ...

error during build:
[vite]: Rollup failed to resolve import "@react-dnd/invariant" from "/app/node_modules/.pnpm/react-dnd@11.1.3_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/react-dnd/dist/esm/hooks/useDrag.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

@zkochan
Copy link
Member Author

zkochan commented Jun 24, 2025

@omar-infinitusai please create a new issue with steps to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pnpm v10.12.2 skips installing transitive dependencies

3 participants