Relative Content

Tag Archive for next.jsnextjs-dynamic-routing

Learn Next.js: Dynamic route returns 404

I am working through the “Learn Next.js”-tutorial and I am stuck on this page, specifically on creating the page for editing an invoice. I keep getting the error “404 – Page not found” and I can’t figure out why.

Unexpected Token Error: Handling 404 Response in NextJS Application

Unexpected Token Error: Handling 404 Response in NextJS Application
GET /chat 404 in 1ms
⨯ Error [SyntaxError]: Unexpected token ‘<‘, “)
at parseJSONFromBytes (file:///Users/prathamchauhan/Documents/Next-Projects/chat-with-pdf/node_modules/next/dist/compiled/edge-runtime/index.js:1:657096)
at successSteps (file:///Users/prathamchauhan/Documents/Next-Projects/chat-with-pdf/node_modules/next/dist/compiled/edge-runtime/index.js:1:657096)
at eval (file:///Users/prathamchauhan/Documents/Next-Projects/chat-with-pdf/node_modules/next/dist/compiled/edge-runtime/index.js:1:657096)
at (node:internal/process/task_queues:140:7)
at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
⨯ Error [ERR_HTTP_HEADERS_SENT]: Cannot append headers after they are sent to the client
at ServerResponse.appendHeader (node:_http_outgoing:759:11)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: “3422819266”
⚠ Fast Refresh had to perform a full reload due to a runtime error.
✓ Compiled in 365ms (3043 modules)
GET /chat 404 in 1ms
⨯ Error [SyntaxError]: Unexpected token ‘<‘, “)
at parseJSONFromBytes (file:///Users/prathamchauhan/Documents/Next-Projects/chat-with-pdf/node_modules/next/dist/compiled/edge-runtime/index.js:1:657096)
at successSteps (file:///Users/prathamchauhan/Documents/Next-Projects/chat-with-pdf/node_modules/next/dist/compiled/edge-runtime/index.js:1:657096)
at eval (file:///Users/prathamchauhan/Documents/Next-Projects/chat-with-pdf/node_modules/next/dist/compiled/edge-runtime/index.js:1:657096)
at (node:internal/process/task_queues:140:7)
at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
⨯ Error [ERR_HTTP_HEADERS_SENT]: Cannot append headers after they are sent to the client
at ServerResponse.appendHeader (node:_http_outgoing:759:11)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: “3422819266”
/chat/page.tsx
import { checkPdf } from ‘@/src/actions/existingPdf’
import ChatComponent from ‘@/src/components/ChatComponent’
import { authOptions } from ‘@/src/lib/auth’
import { getServerSession } from ‘next-auth’
import { redirect } from ‘next/navigation’
import React from ‘react’

Next js navigation 404 not found

I’ve just created a new next js project and I’m currently implementing the client-side navigation.
The problem is that I ‘m not able to navigate to another route than “/”.