bluebeel / nextjs-shopify

This repository contains the app without webhook for the Build a Shopify app with Node and React tutorial.
nextjs-shopify-bluebeel.vercel.app
MIT License
75 stars 22 forks source link

First setup issue with dynamic shopOrigin #10

Open rafaelstz opened 3 years ago

rafaelstz commented 3 years ago

Hi,

First of all, nice project, thank you for sharing it! I had difficulties to set it up, so if you can help I will be grateful!

I completed the installation, adding valid keys and host with my Ngrok URL but running the npm run dev in my local or uploading to Vercel I got this result below.

SerializableError: Error serializing `.shopOrigin` returned from `getServerSideProps` in "/".
Reason: `undefined` cannot be serialized as JSON. Please use `null` or omit this value.
    at isSerializable (/workspaces/test-app/node_modules/next/dist/lib/is-serializable-props.js:7:95)
    at /workspaces/test-app/node_modules/next/dist/lib/is-serializable-props.js:7:490
    at Array.every (<anonymous>)
    at isSerializable (/workspaces/test-app/node_modules/next/dist/lib/is-serializable-props.js:7:291)
    at isSerializableProps (/workspaces/test-app/node_modules/next/dist/lib/is-serializable-props.js:9:219)
    at renderToHTML (/workspaces/test-app/node_modules/next/dist/next-server/server/render.js:42:1318)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async /workspaces/test-app/node_modules/next/dist/next-server/server/next-server.js:112:97
    at async /workspaces/test-app/node_modules/next/dist/next-server/server/next-server.js:105:142
    at async DevServer.renderToHTMLWithComponents (/workspaces/test-app/node_modules/next/dist/next-server/server/next-server.js:137:387)
    at async DevServer.renderToHTML (/workspaces/test-app/node_modules/next/dist/next-server/server/next-server.js:138:610)
    at async DevServer.renderToHTML (/workspaces/test-app/node_modules/next/dist/server/next-dev-server.js:36:578)
    at async DevServer.render (/workspaces/test-app/node_modules/next/dist/next-server/server/next-server.js:75:160)
    at async Object.fn (/workspaces/test-app/node_modules/next/dist/next-server/server/next-server.js:58:672)
    at async Router.execute (/workspaces/test-app/node_modules/next/dist/next-server/server/router.js:25:67)
event - build page: /next/dist/pages/_error

I changed the shopOrigin to a static value to check and this below is the next issue that I'm having.

Capture d’écran, le 2021-08-04 à 08 29 03

Thank you! Regards, Rafael