pwa-studio
pwa-studio copied to clipboard
[bug]: Certain talons and hooks cannot be wrapped
Describe the bug
Peregrine exposes its talons and hooks based on the file name. If the talon or hook does not export a variable with the same name, wrapping causes the error below. There are a select few that export default instead of a named variable.
WARNING in ./node_modules/@magento/peregrine/lib/talons/ContactPage/useContactLink.js
Module Warning (from ./node_modules/@magento/pwa-buildpack/lib/WebpackTools/loaders/wrap-esm-loader.js):
(Emitted value instead of an instance of Error) wrap-js-loader: Cannot wrap export "useContactLink" of "/projects/rnd/pwastudio/pwastudio-accelerator/packages/accelerator/node_modules/@magento/peregrine/lib/talons/ContactPage/useContactLink.js" with module "src/talons/ContactPage/useContactLink.wrap" because it does not have an export named "useContactLink".
To reproduce
Steps to reproduce the behavior:
- Using targets, wrap one of the talons that exports default instead of a named variable
- Run build
- Error thrown
Expected behavior
No error thrown for any talon or hook
Possible solutions
Export named variables across all talons and hooks
Please let us know what packages this bug is in regards to:
- [ ]
venia-concept
- [x]
venia-ui
- [ ]
pwa-buildpack
- [x]
peregrine
- [ ]
pwa-devdocs
- [ ]
upward-js
- [ ]
upward-spec
- [ ]
create-pwa
Hi @JustinConabreeAbsolunet. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento I am working on this
Hi @JustinConabreeAbsolunet! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team
command to join Contributors team.
@magento add to contributors team
Hi @JustinConabreeAbsolunet! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.
@magento add to contributors team
@magento export issue to JIRA project PWA as Bug
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/PWA-2899 is successfully created for this GitHub issue.