pwa-studio
pwa-studio copied to clipboard
[bug]: useLink operations empty object destructuring
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)
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
- Join Magento Community Engineering Slack and ask your questions in #github channel.
@adobe export issue to JIRA project PWA as Bug
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/PWA-2967 is successfully created for this GitHub issue.
Probably a duplicate of https://github.com/magento/pwa-studio/issues/3906
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