Api error during build
Unanswered
Asiatic Lion posted this in #help-forum
Asiatic LionOP
i am getting this error msg while deploying my project on vercel
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:5738:19)
at successSteps (node:internal/deps/undici/undici:5719:27)
at fullyReadBody (node:internal/deps/undici/undici:4609:9)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async consumeBody (node:internal/deps/undici/undici:5728:7)
at async c (/vercel/path0/.next/server/app/(root)/page.js:1:10299)
Export encountered an error on /(root)/page: /, exiting the build.
⨯ Next.js build worker exited with code: 1 and signal: null
Error: Command "npm run build" exited with 1
i have read the docs and it said i should call query directly in my component
but i want to add some caching to it like if i request for the same blog 2 times within 60 sec it should come from cache that would reduce the query on my db side
can anyone help me with this
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:5738:19)
at successSteps (node:internal/deps/undici/undici:5719:27)
at fullyReadBody (node:internal/deps/undici/undici:4609:9)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async consumeBody (node:internal/deps/undici/undici:5728:7)
at async c (/vercel/path0/.next/server/app/(root)/page.js:1:10299)
Export encountered an error on /(root)/page: /, exiting the build.
⨯ Next.js build worker exited with code: 1 and signal: null
Error: Command "npm run build" exited with 1
i have read the docs and it said i should call query directly in my component
but i want to add some caching to it like if i request for the same blog 2 times within 60 sec it should come from cache that would reduce the query on my db side
can anyone help me with this
1 Reply
Asiatic LionOP
never mind got the answer from a previous forum thanks to joulev