You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I updated a project's @wordpress/babel-plugin-makepot dependency to 5.0.0, its build started showing a TypeError with the message "translations is not iterable".
I am not an expert by any means, but from what I can tell, Lodash's sortBy()expected either an array or an object to be passed. The new sortByReference() added to babel-plugin-makepot as a replacement expects and handles only arrays even though the translations passed to it by babel-plugin-makepot are always objects.
I can't find an example of how Gutenberg or WordPress are using this package, so I'm not completely confident that I'm not doing something wrong, but I've reproduced the issue in a simple package and have found at least one example on GitHub of another project using this package with the same error.
Description
After I updated a project's
@wordpress/babel-plugin-makepot
dependency to 5.0.0, its build started showing a TypeError with the message "translations is not iterable".I looked at the commit history for the package and while the release notes show an upgrade to Node 14 as a breaking change, a commit was included that replaces the use of Lodash's
sortBy()
.I am not an expert by any means, but from what I can tell, Lodash's
sortBy()
expected either an array or an object to be passed. The newsortByReference()
added to babel-plugin-makepot as a replacement expects and handles only arrays even though the translations passed to it by babel-plugin-makepot are always objects.I can't find an example of how Gutenberg or WordPress are using this package, so I'm not completely confident that I'm not doing something wrong, but I've reproduced the issue in a simple package and have found at least one example on GitHub of another project using this package with the same error.
Step-by-step reproduction instructions
npm install
npm run build
If you check out the
wp-babel-4.0.0
branch on that project, there is no error.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: