next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Stuck on Chapter 12, getting 404 when clicking Edit Invoice Button

Open ailj89 opened this issue 11 months ago • 4 comments

I am stuck on Chapter 12, section 3 Fetch the specific invoice. I followed the tutorial exactly but when I click the edit invoice button (the pencil), an edit form for the invoice does not populate. I instead get a 404 page, regardless of which invoice I attempt to edit. I looked ahead at the final-example to see if maybe there was a syntax error in my code, there was not. Please let me know what information I may provide (snippets, etc...) to update this post so that I may complete the tutorial.

image

image

Thanks,

  • Andre

ailj89 avatar Mar 04 '24 21:03 ailj89

i too am getting this. even after finishing the chapter.

bradallenfisher avatar Apr 21 '24 13:04 bradallenfisher

Me too! Creating and deleting invoices work, but editing leads to an error even before implementing the 404 page, because somewhere is passing the wrong uuid to UpdateInvoice, which led to the error that the id doesn't exist in the DB. Here is the error:

Database Error: NeonDbError: invalid input syntax for type uuid: "%24%7Bid%7D" at execute (webpack-internal:///(rsc)/./node_modules/@neondatabase/serverless/index.js:4713:70) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async fetchInvoiceById (webpack-internal:///(rsc)/./app/lib/data.ts:137:22) at async Promise.all (index 0) at async Page (webpack-internal:///(rsc)/./app/dashboard/invoices/[id]/edit/page.tsx:19:34) { code: '22P02', sourceError: undefined } ⨯ app/lib/data.ts (171:10) @ fetchInvoiceById ⨯ Error: Failed to fetch invoice. at fetchInvoiceById (./app/lib/data.ts:154:15) at async Promise.all (index 0) at async Page (./app/dashboard/invoices/[id]/edit/page.tsx:19:34) 169 | } catch (error) { 170 | console.error('Database Error:', error);

171 | throw new Error('Failed to fetch invoice.'); | ^ 172 | } 173 | }

Shining-Chen avatar May 30 '24 18:05 Shining-Chen