@wordpress/icons
, @wordpress/interactivity
, and @wordpress/react-i18n
are missing a dependency on react
#55171
Labels
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
After #54494,
@wordpress/icons
,@wordpress/interactivity
, and@wordpress/react-i18n
are now lacking dependencies or peer dependencies onreact
.@wordpress/interactivity
also appears to be lacking a dependency or peer dependency on@babel/runtime
.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.Reproduction
With yarn:
echo '{}' > package.json
yarn set version stable
yarn add @wordpress/icons @wordpress/interactivity @wordpress/react-i18n jsdom global-jsdom @babel/runtime
yarn node -e 'require( "global-jsdom/register" ); const x = require( "@wordpress/icons" ); console.log( typeof x );'
yarn node -e 'require( "global-jsdom/register" ); const x = require( "@wordpress/interactivity" ); console.log( typeof x );'
yarn node -e 'require( "global-jsdom/register" ); const x = require( "@wordpress/react-i18n" ); console.log( typeof x );'
With pnpm:
echo 'hoist-pattern=[]' > .npmrc
pnpm add @wordpress/icons @wordpress/interactivity @wordpress/react-i18n global-jsdom @babel/runtime
(note pnpm 8 defaults to installing peer deps)node -e 'require( "global-jsdom/register" ); const x = require( "@wordpress/icons" ); console.log( typeof x );'
node -e 'require( "global-jsdom/register" ); const x = require( "@wordpress/interactivity" ); console.log( typeof x );'
node -e 'require( "global-jsdom/register" ); const x = require( "@wordpress/react-i18n" ); console.log( typeof x );'
Expected behavior
Output along the lines of
Actual behavior
With yarn:
With pnpm:
The text was updated successfully, but these errors were encountered: