Next.js Discord

Discord Forum

404 in next14

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
In my terminal, I keep getting this compile error GET /_next/static/chunks/pages/types.js.map 404 in 54ms but I have no idea where it is coming from. has anyone ran into this before? I don't see htis file in the chunks/page/ directory either

7 Replies

Asian black bearOP
yep I tried doing that. it would always start out with /404 before anything. not too sure how to debug this

○ Compiling /404 ...
✓ Compiled /404 in 10.4s (7428 modules)
GET /404 404 in 41280ms
GET /_next/webpack-hmr 404 in 42773ms
GET /_next/static/webpack/84d4a1b73db6a181.webpack.hot-update.json 404
GET /_next/static/chunks/pages/types.js.map 404 in 49ms
○ Compiling /view...
✓ Compiled /view in 3.1s (8000 modules)
Asian black bearOP
yep it looks like it is something related to my custom 404 page. I removed them and the errors went away. I will look into it a bit more, thanks!
Asian black bearOP
hmm I deleted them, but I occassionally run into it still. _error is the default nextjs error page :/

○ Compiling /_error ...
✓ Compiled /_error in 18.3s (7425 modules)
GET /_next/webpack-hmr 404 in 19683ms
GET /_next/static/webpack/242cd092558f4275.webpack.hot-update.json 404 in 87ms
Asian black bearOP
yep, which component would you like me to share?

below is my _error

import { ErrorPage } from '@/components/ErrorPage'

type StatusCode = { statusCode?: number }

function Error({ statusCode }: StatusCode) {
  return <ErrorPage statusCode={statusCode} />
}
Error.getInitialProps = ({
  res,
  err,
}: {
  res: StatusCode
  err: StatusCode | Error
}) => {
  const statusCode = res
    ? res.statusCode
    : err && 'statusCode' in err
    ? err.statusCode
    : 404
  return { statusCode, err }
}

export default Error