0

I'm running into an error and would appreciate some assistance.

I created a "CRUD" project that renders data stored in a local data.json file. On localhost I am using SWR to fetch the data. User is able to update data and create new data. On localhost I am able to fetch the data and render either the updated/created data.

On the live Vercel site, once the user has tried to update/create data, an error message consoles onto the log.


PUT https://feedback-dashboard-morfeli.vercel.app/api/feedback/edit-feedback 

VM2288:1 Uncaught (in promise) SyntaxError: Unexpected end of JSON input
    at [id]-a99fbfe26a07e1bb.js:1:3153

I believe this has something to do with a proxy.. unsure here..

Felipe
  • 333
  • 7
  • 19
  • Do the Vercel logs show any error on the API route that's being called? Could you provide the code for both the request you're doing from the client and the API route itself? – juliomalves Jun 02 '22 at 16:18
  • @juliomalves thanks Julio for reaching out. The problem is that initially I was writing to the json file with either or api request. Yes it works fine locally, but not on live site. Im going to rebuild the app and instead of writing to a local json file, I will use a database to create, update, read etc.. – Felipe Jun 02 '22 at 16:56

0 Answers0