pwa-studio icon indicating copy to clipboard operation
pwa-studio copied to clipboard

[bug]: useLink operations empty object destructuring

Open V-Arakelyan opened this issue 3 years ago • 4 comments

Hi guys!

I've encountered during project's upgrade from PWA 10.0.0 -> 12.5.0 this chunk of the code, which breaks project's execution, and I believe there is some logic written wrong in @magento/peregrine/lib/talons/Link/useLink.js:

const operations = shouldPrefetch ? mergeOperations(DEFAULT_OPERATIONS, passedOperations) : {}

after assigning empty object to operations, couple of lines below it gets destructured to resolveUrlQuery, which is then passed to useLazyQuery, which eventually throws runtime exception, as the resolveUrlQuery is undefined.

I've fixed this via targetables and changed empty object to DEFAULT_OPERATIONS, and everything works like a charm.

Could you please address this issue?

Thanks.

Test Plan

  • Verify Current CI builds works
  • Verify Scaffolding works
  • Create a project via scaffolding with PWA 10.0 and try to upgrade with latest (fixed version)

V-Arakelyan avatar Aug 04 '22 08:08 V-Arakelyan

Hi @V-Arakelyan. 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


m2-assistant[bot] avatar Aug 04 '22 08:08 m2-assistant[bot]

@adobe export issue to JIRA project PWA as Bug

anthoula avatar Aug 16 '22 18:08 anthoula

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/PWA-2967 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Aug 16 '22 18:08 github-jira-sync-bot

Probably a duplicate of https://github.com/magento/pwa-studio/issues/3906

justinconabree avatar Aug 23 '22 14:08 justinconabree

Hello, As I can see this issue got fixed in the scope of the internal Jira ticket PWA-2967 by merging community PR https://github.com/magento/pwa-studio/pull/3907 
Related commits: https://github.com/magento/pwa-studio/commit/13d295a2a879d07b80ee448c47003a988cffd02e

Hence I am closing this issue.

Thanks

glo82145 avatar May 24 '23 12:05 glo82145