-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
No collection found for hidden-homepage-carousel
and hidden-homepage-featured-items
#1207
Comments
Test it yourselves to see if this solution is correct. |
Wow. Haha. What a funny bug. That fixed my problem. Thanks! I would have never figured that out. |
Why is this closed? The issue is still in the code: https://github.com/vercel/commerce/blob/3a18f9a0986db76e2d300a80466276a1040687b1/lib/shopify/queries/collection.ts#L55C1 Unfortunately prettier auto-formats the query in the wrong format. For me the solution was adding |
Idk why I closed this issue, my bad |
The space is on two lines of
|
Nothing works for me. I started from scratch, followed the instructions again, corrected the bug but nothing. Since I deleted some products from shopify I can't read anymore the data from the API. |
is this normal when I'm supposed to receive data from shopify?
|
You need to add two collections and associate with products. |
Not sure why but doing this did not work:
...Prettier continued auto-saving. What DID work for me was adding For example: // prettier-ignore
export const getCollectionQuery = /* GraphQL */ `
query getCollection($handle: String!) {
collection(handle: $handle) {
...collection
}
}${collectionFragment}
`; Then, repeat for each query in the file. |
Hello everyone, I’m encountering the same issue with my Next.js application where the carousel does not appear when I run the app locally, although it functions correctly when deployed on Vercel. The homepage and other features work fine in both environments, but this specific bug with the carousel is puzzling. Here’s the link to the live site for reference: https://nextjs-commerce-nao-aguento-mais.vercel.app/ Does anyone know what might be causing this discrepancy between the local and deployed versions? Any insights or fixes would be greatly appreciated! ![]() ![]() ![]() |
Due to caching, I had a similar problem when playing with this. After adding the solutions mentioned here I also updated the export const SHOPIFY_GRAPHQL_API_ENDPOINT = '/api/2023-01/graphql.json'; to use different versions of the API. I'm sure at some point this strategy will fail with breaking changes after a deprecation cycle. Also, there has to be a better strategy to cache bust around the query or the client. But for now it helped me 😄
This is a better way 😅 Lines 61 to 62 in 7fd9ad8
Change calls to that function to use |
Any reason why this isn't merged in the codebase yet? |
Please can anyone alive help me, my carousel shows up locally but not on prod.. Do I need a different set of API keys for prod? |
fwiw I had to implement every change suggested here and I also had to create new collections and swap the collections specified in this codebase(carousel.tsx & three-items.tsx) with the names of the new collections I created. |
I was able to solve this error on my own, and I'm posting it here for anyone who encounters the same issue. The context is as follows: I had already correctly filled out my .env.local file, created the collections with the correct link, and still found that I was getting an error. After a long time, I discovered that the error was simply due to spacing in
lib/shopify/queries/collection.ts
, in thegetCollectionProductsQuery
function:changed to:
The text was updated successfully, but these errors were encountered: