#Deployment error

8 messages · Page 1 of 1 (latest)

wispy hatch
#

Hello, I have been trying to fix a deployment issue with vercel with no success the error i am getting is Image1, when it comes to local development the project does not have any issue. I am using contentful for cms and route.ts

import { client } from "@/lib/contentful_config"; import { NextResponse } from "next/server"; export const dynamic = "force-dynamic"; export const GET = async (request: Request) => { const entries = await client.getEntries({ content_type: "something" }); return NextResponse.json(entries.items); };

NB: locally everything is fine apart from when i deploy it to vercel.

trail summitBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

cerulean lava
#

You're going to need to debug your fetch cause its not returning a json response(meaning its failing).

#

Also a ok check is a must imo especially when you are dealing with third party api:

const res = await fetch(..);
if(!res.ok) // do error handling
// else
const resJson = res.json()
wispy hatch
heady pivot
wispy hatch
#

I have discovered the solution it turns out that vercel can not handle deploying a huge project at once so i broke down my deployment into chunks of commits and it worked out for me thank you very much

trail summitBOT
#
✅ Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer

[Click here](#1256281345743913083 message)