Next.js Discord

Discord Forum

Differences in local and vercel builds

Unanswered
Mugger Crocodile posted this in #help-forum
Open in Discord
Mugger CrocodileOP
Hi folks! I recently started getting build errors in vercel that I don't get in my local builds, making them hard to debug.
In vercel, I see
- info Collecting page data...
InvalidEndpointError: Invalid endPoint : undefined
    at new TypedClient (/vercel/path0/.next/server/chunks/875.js:21468:19)
    at new Client (/vercel/path0/.next/server/chunks/875.js:23693:1)
    at 78124 (/vercel/path0/.next/server/chunks/124.js:18:21)
    at __webpack_require__ (/vercel/path0/.next/server/webpack-runtime.js:25:43)
    at 41491 (/vercel/path0/.next/server/app/almacen/route.js:131:13)
    at __webpack_require__ (/vercel/path0/.next/server/webpack-runtime.js:25:43)
    at __webpack_exec__ (/vercel/path0/.next/server/app/almacen/route.js:203:39)
    at /vercel/path0/.next/server/app/almacen/route.js:204:78
    at __webpack_require__.X (/vercel/path0/.next/server/webpack-runtime.js:150:21)
    at /vercel/path0/.next/server/app/almacen/route.js:204:47
> Build error occurred
Error: Failed to collect page data for /almacen
    at /vercel/path0/node_modules/next/dist/build/utils.js:1156:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'Error'
}
error Command failed with exit code 1.


as well as

- error Failed to find font override values for font `Ysabeau`


For the latter, I saw a github issue which points to a bug in the framework, which I'm willing to workaround until the fix comes out. But for the first one I have no clue. That endpoint just exports a POST function as all the others in my codebase. I'm using the AppRouter. I read about it being unstable.

I wonder whether there's a way of approximating my local build environment to that of vercel, such that I can catch build errors before deploying.

Any pointers on the InvalidEndpointError are also welcome

Thanks!

1 Reply

Mugger CrocodileOP
PS: In my local build the same endpoint compiles beautifully

Route (app)                                Size     First Load JS
┌ ○ /                                      57.5 kB         136 kB
├ ○ /admin                                 135 B          78.4 kB
├ λ ***/almacen***                         0 B                0 B
├ λ /almacen/limpiar                       0 B                0 B
├ λ /eventos                               0 B                0 B
├ λ /eventos/scrap/[fuente]                0 B                0 B
└ λ /login                                 0 B                0 B
+ First Load JS shared by all              78.2 kB
  ├ chunks/596-be0034bdbb127016.js         25.7 kB
  ├ chunks/fd9d1056-6a406dbe87aff653.js    50.5 kB
  ├ chunks/main-app-3a57d59df4a03981.js    212 B
  â”” chunks/webpack-d2473d28c77401dc.js     1.81 kB

Route (pages)                              Size     First Load JS
─ ○ /404                                   182 B          75.8 kB
+ First Load JS shared by all              75.6 kB
  ├ chunks/framework-8883d1e9be70c3da.js   45 kB
  ├ chunks/main-5823590e8d0a29e5.js        28.6 kB
  ├ chunks/pages/_app-52924524f99094ab.js  195 B
  â”” chunks/webpack-d2473d28c77401dc.js     1.81 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
â—‹  (Static)  automatically rendered as static HTML (uses no initial props)