-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wp-scripts: Build fails when using pnpm with hoisting disabled. #67866
Comments
which is listed as a dependency for gutenberg/packages/scripts/package.json Line 38 in 94df941
I'm not sure what exactly happens when using Is that issue specific to |
It's something related to the import of
No, it's a general issue. |
I was checking The plugin is so simple that we could consider forking it. In fact, we already use a fork ... 😅 |
I'm working on a potential fix: |
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- /node_modules/.pnpm/[email protected]/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/[email protected][email protected][email protected][email protected]/node_modules/webpack-cli/lib/webpack-cli.js
- /node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/webpack-cli/lib/bootstrap.js
- /node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/webpack-cli/bin/cli.js
- /node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/bin/webpack.js
[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:
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/[email protected]/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/[email protected]/node_modules/rtlcss-webpack-plugin/dist/src/index.js',
'/node_modules/.pnpm/@[email protected]@[email protected]@[email protected]@types+node@22.10.2_@ty_wroepmchm5g4fgh3o3zlqgqj4a/node_modules/@wordpress/scripts/config/webpack.config.js',
'/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/webpack-cli/lib/webpack-cli.js',
'/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/webpack-cli/lib/bootstrap.js',
'/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/webpack-cli/bin/cli.js',
'/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/bin/webpack.js'
]
}
ELIFECYCLE Command failed with exit code 2.
Step-by-step reproduction instructions
pnpm remove @babel/runtime
pnpm install
pnpm build
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: