Could you explain this error a bit more?
I recently upgraded @Shopify_77 /app-bridge-react and @Shopify_77 /app-bridge-utils to 2.02 and I’ve been receiving the following error on my queries:
Error: Network error: Unexpected token N in JSON at position 0
I’ve tested my query in the Shopify GraphiQL App and it works fine there. Here is my query:
export const GET_NEXT_PRODUCTS = gqlquery ($first: Int, $cursor: String) { products(first: $first, after: $cursor) { pageInfo { hasNextPage hasPreviousPage } edges { cursor node { id title handle description images(first: 1) { edges { node { originalSrc altText } } } tiktok: metafield ( namespace: "tiktok" key: "tiktok") { value id } } } } };
And server.js:
router.post(“/graphql”, async (ctx, next) => {
const bearer = ctx.request.header.authorization;
const secret = process.env.SHOPIFY_API_PRIVATE_KEY;
const valid = isVerified(bearer, secret);
if (valid) {
const token = bearer.split(" ")[1];
const decoded = jwt.decode(token);
const shop = new URL(decoded.dest).host;
const accessToken = store.get(‘token’);
if (shop) {
const proxy = graphQLProxy({
shop: shop,
password: accessToken,
version: ApiVersion.April21,
});
await proxy(ctx, next);
} else {
ctx.res.statusCode = 403;
}
}
});


