You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an unhandled runtime error with the message "Unexpected end of JSON input" while running the demo locally. The error occurs after successfully connecting to the Postgres database. It appears to be related to missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN in the @vercel/kv module. As I'm not familiar with Next.js and Vercel, I may be missing something crucial in my setup.
Environment:
Operating System: Windows 11 23H2
PostgreSQL Version: 15
Node.js Version: 18.16.0
Yarn Version: 3.2.1
Commands I used to start this project:
yarn
yarn product:migrations:run
yarn product:seed
yarn dev
Here's an extract from the terminal output:
[info] MikroORM successfully connected to database themedusa on postgres://postgres:*****@localhost:5432
[query] select 1 from pg_database where datname = 'themedusa' [took 5 ms]
- error Error: @vercel/kv: Missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN
at Object.get (webpack-internal:///(sc_server)/./node_modules/@vercel/kv/dist/index.js:60:87)
at queryProducts (webpack-internal:///(sc_server)/./src/app/api/products/route.ts:54:61)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async GET (webpack-internal:///(sc_server)/./src/app/api/products/route.ts:23:83)
at async eval (webpack-internal:///(sc_server)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:244:37)
- error SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
- ┌ GET / 200 in 15205ms
│
└──── GET http://localhost:3000/api/products 500 in 12276ms (cache: MISS)
- error SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
digest: "4266806755"
- error Error: connect ECONNREFUSED ::1:9000
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
- error Error: connect ECONNREFUSED ::1:9000
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
- error Error: connect ECONNREFUSED ::1:9000
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
digest: "2765090518"
Thanks in advance for the help!
The text was updated successfully, but these errors were encountered:
I encountered an unhandled runtime error with the message "Unexpected end of JSON input" while running the demo locally. The error occurs after successfully connecting to the Postgres database. It appears to be related to missing required environment variables KV_REST_API_URL and KV_REST_API_TOKEN in the @vercel/kv module. As I'm not familiar with Next.js and Vercel, I may be missing something crucial in my setup.
Environment:
Commands I used to start this project:
Here's an extract from the terminal output:
Thanks in advance for the help!
The text was updated successfully, but these errors were encountered: