-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
[Tool] WP Scripts/packages/scripts/packages/scripts[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
While reproducing #67864, I noticed that if I don't install @bable/runtime as a dependency, I see an error when using pnpm with hoisting disabled.
Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'
The fix the probably to have @bable/runtime as a dependency for the scripts package.
⚠ Click to expand the full error reported ⚠
> wp-scripts build
[webpack-cli] Failed to load '/node_modules/.pnpm/@wordpress+scripts@30.7.0_@playwright+test@1.49.1_@types+eslint@9.6.1_@types+node@22.10.2_@ty_wroepmchm5g4fgh3o3zlqgqj4a/node_modules/@wordpress/scripts/config/webpack.config.js' config
[webpack-cli] Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'
Require stack:
- /node_modules/.pnpm/rtlcss-webpack-plugin@4.0.7/node_modules/rtlcss-webpack-plugin/dist/src/index.js
- /node_modules/.pnpm/@wordpress+scripts@30.7.0_@playwright+test@1.49.1_@types+eslint@9.6.1_@types+node@22.10.2_@ty_wroepmchm5g4fgh3o3zlqgqj4a/node_modules/@wordpress/scripts/config/webpack.config.js
- /node_modules/.pnpm/webpack-cli@5.1.4_webpack-bundle-analyzer@4.10.2_webpack-dev-server@4.15.2_webpack@5.97.1/node_modules/webpack-cli/lib/webpack-cli.js
- /node_modules/.pnpm/webpack-cli@5.1.4_webpack-bundle-analyzer@4.10.2_webpack-dev-server@4.15.2_webpack@5.97.1/node_modules/webpack-cli/lib/bootstrap.js
- /node_modules/.pnpm/webpack-cli@5.1.4_webpack-bundle-analyzer@4.10.2_webpack-dev-server@4.15.2_webpack@5.97.1/node_modules/webpack-cli/bin/cli.js
- /node_modules/.pnpm/webpack@5.97.1_webpack-cli@5.1.4/node_modules/webpack/bin/webpack.js
at Function.resolveFilename (node:internal/modules/cjs/loader:1249:15)
at Function.load (node:internal/modules/cjs/loader:1075:27)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
at Module.require (node:internal/modules/cjs/loader:1340:12)
at require (node:internal/modules/helpers:141:16)
at Object. (/node_modules/.pnpm/rtlcss-webpack-plugin@4.0.7/node_modules/rtlcss-webpack-plugin/dist/src/index.js:3:30)
at Module.compile (node:internal/modules/cjs/loader:1546:14)
at Object..js (node:internal/modules/cjs/loader:1689:10)
at Module.load (node:internal/modules/cjs/loader:1318:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/node_modules/.pnpm/rtlcss-webpack-plugin@4.0.7/node_modules/rtlcss-webpack-plugin/dist/src/index.js',
'/node_modules/.pnpm/@wordpress+scripts@30.7.0@playwright+test@1.49.1@types+eslint@9.6.1@types+node@22.10.2_@ty_wroepmchm5g4fgh3o3zlqgqj4a/node_modules/@wordpress/scripts/config/webpack.config.js',
'/node_modules/.pnpm/webpack-cli@5.1.4_webpack-bundle-analyzer@4.10.2_webpack-dev-server@4.15.2_webpack@5.97.1/node_modules/webpack-cli/lib/webpack-cli.js',
'/node_modules/.pnpm/webpack-cli@5.1.4_webpack-bundle-analyzer@4.10.2_webpack-dev-server@4.15.2_webpack@5.97.1/node_modules/webpack-cli/lib/bootstrap.js',
'/node_modules/.pnpm/webpack-cli@5.1.4_webpack-bundle-analyzer@4.10.2_webpack-dev-server@4.15.2_webpack@5.97.1/node_modules/webpack-cli/bin/cli.js',
'/node_modules/.pnpm/webpack@5.97.1_webpack-cli@5.1.4/node_modules/webpack/bin/webpack.js'
]
}
ELIFECYCLE Command failed with exit code 2.
Step-by-step reproduction instructions
- Checkout Reproducing @wordpress/dataviews build failure using pnpm with hoisting disabled wptrainingteam/devblog-dataviews-plugin#4
- Run
pnpm remove @babel/runtime - Run
pnpm install - Run
pnpm build - See the build failure
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Tool] WP Scripts/packages/scripts/packages/scripts[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended