Closed anomiex closed 3 months ago
cc @youknowriad @Mamaduka
Good point, I think the root of the issue predates the PR. Basically, it seems that all packages that use JSX should have a direct react
dependency. primitives is one of them, maybe there are more.
Created PR - #64218.
@wordpress/primitives
is lacking a dependency or peer dependency onreact
.This happens to work with
npm
's hoisting due to other dependencies pulling that package in, but will fail with yarn's p'n'p or pnpm with hoisting disabled.This seems to have begun with #61692.
Reproduction
With yarn:
echo '{}' > package.json
yarn set version stable
yarn add @wordpress/primitives
yarn node -e 'const x = require( "@wordpress/primitives" );'
With pnpm:
echo 'hoist-pattern=[]' > .npmrc
pnpm add @wordpress/primitives
(note pnpm 8 defaults to installing peer deps)node -e 'const x = require( "@wordpress/primitives" );'
Expected behavior
Command runs.
Actual behavior
With yarn:
With pnpm: