Discussions

Ask a Question
Back to All

Can't use @rebuy/rebuy-hydrogen with @shopify/hydrogen version 2023.7.1

Greetings, community!

Questions regarding Rebuy npm package and hydrogen package version 2023.7.1.
Unfortunately, there are no clear instructions for this version of hydrogen.

Therefore, I will show what flow I use:
after installing the package, I wrap the components in the RebuyContextProvider in the entry.client.tsx file. The error that occurs -

../../node_modules/@rebuy/rebuy-hydrogen/RebuyContextProvider.client.jsx:4:9: ERROR: No matching export in "../../node_modules/@shopify/hydrogen/dist/production/index.js" for import "useCart" ../../node_modules/@rebuy/rebuy-hydrogen/RebuyContextProvider.client.jsx:4:18: ERROR: No matching export in "../../node_modules/@shopify/hydrogen/dist/production/index.js" for import "useShop" ../../node_modules/@rebuy/rebuy-hydrogen/RebuyContextProvider.client.jsx:4:27: ERROR: No matching export in "../../node_modules/@shopify/hydrogen/dist/production/index.js" for import "useUrl"

can't import useCart, useUrl, useShop from @shopify/hydrogen - they simply do not exist in the current version of hydrogen. I guess there should be another aproach, but not sure @rebuy/rebuy-hydrogen can be used with hydrogen-2.0 due to old last update (Published 7 months ago).

Really appreciate any help.

Many thanks in advance!