Skip to content
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

[bug]: Certain talons and hooks cannot be wrapped #3873

Closed
2 of 8 tasks
justinconabree opened this issue Jun 1, 2022 · 8 comments · Fixed by #3874
Closed
2 of 8 tasks

[bug]: Certain talons and hooks cannot be wrapped #3873

justinconabree opened this issue Jun 1, 2022 · 8 comments · Fixed by #3874
Assignees
Labels
bug Something isn't working Progress: done

Comments

@justinconabree
Copy link
Contributor

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:

  1. Using targets, wrap one of the talons that exports default instead of a named variable
  2. Run build
  3. 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
  • venia-ui
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
  • create-pwa
@justinconabree justinconabree added the bug Something isn't working label Jun 1, 2022
@m2-assistant
Copy link

m2-assistant bot commented Jun 1, 2022

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


@justinconabree
Copy link
Contributor Author

@magento I am working on this

@m2-assistant
Copy link

m2-assistant bot commented Jun 1, 2022

Hi @JustinConabreeAbsolunet! 👋
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.

@justinconabree
Copy link
Contributor Author

@magento add to contributors team

@m2-assistant
Copy link

m2-assistant bot commented Jun 1, 2022

Hi @JustinConabreeAbsolunet! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@justinconabree
Copy link
Contributor Author

@magento add to contributors team

@anthoula
Copy link
Contributor

anthoula commented Jun 6, 2022

@magento export issue to JIRA project PWA as Bug

@anthoula anthoula added the needs-triage A pull request or issue that needs to be triaged prior to being synced to JIRA label Jun 6, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/PWA-2899 is successfully created for this GitHub issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Progress: done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants