Next.js Discord

Discord Forum

Fetching Shopify Products in Next.js (App Router) - Data Not Found

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Hi everyone, I’m using Next.js 15.0.1 with the App Router and TypeScript to fetch products from the Shopify Storefront API.

Here’s what I’ve done:

1. Added SHOPIFY_STORE_DOMAIN and SHOPIFY_STOREFRONT_API_TOKEN in .env.local.


2. Created an API route in app/api/api.ts.


3. Defined types in types/types.ts for proper TypeScript handling.



Despite this setup, the console shows:

something related fetch data issues

The query works fine in Shopify GraphiQL. Is there something specific I might be missing with the App Router or TypeScript configuration?

0 Replies