warning package is not compatible with webpack 5 #44950
Labels
[Package] Warning
/packages/warning
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
[Type] Build Tooling
Issues or PRs related to build tooling
Description
@wordpress/warning
and itsbabel-plugin
rely onprocess.env
. So forenv == 'production'
it's supposed not to show the warning.The problem is webpack 5 removed
process
variable completely:So, the
typeof process !== 'undefined' && process.env !=== 'production'
is always false, which preventswarning
to be called for any kind of environment.Step-by-step reproduction instructions
Follow the package's README
@wordpress/warning/babel-plugin
into your babel config or use@wordpress/babel-preset-default
, which already includes the babel plugin.Screenshots, screen recording, code snippet
No response
Environment info
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
The text was updated successfully, but these errors were encountered: