Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: npx @cloudflare/next-on-pages results in unexpected error #827

Closed
1 task done
NBandNB opened this issue Jul 11, 2024 · 2 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@NBandNB
Copy link

NBandNB commented Jul 11, 2024

next-on-pages environment related information

System:
Platform: linux
Arch: x64
Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Memory: 16 GB
Shell: /bin/bash
Package Manager Used: npm (9.2.0)

Relevant Packages:
@cloudflare/next-on-pages: 1.12.1
vercel: N/A
next: 14.2.5

Description

When attempting to build my project using npx @cloudflare/next-on-pages it results in an unexpected error, "Unexpected error: The "path" argument must be of type string. Received undefined"

Verbose Log:


> npm verb cli /usr/bin/node /usr/share/nodejs/npm/bin/npm-cli.js
> npm info using [email protected]
> npm info using [email protected]
> npm verb title npm exec @cloudflare/next-on-pages -o .vercel/output/static
> npm verb argv "exec" "--loglevel" "verbose" "--" "@cloudflare/next-on-pages" "-o" ".vercel/output/static"
> npm verb logfile logs-max:10 dir:/home/natel/.npm/_logs/2024-07-11T19_03_36_099Z-
> npm verb logfile /home/natel/.npm/_logs/2024-07-11T19_03_36_099Z-debug-0.log
> npm verb shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/prisma
> ⚡️ @cloudflare/next-on-pages CLI v.1.12.1
> ⚡️ Detected Package Manager: npm (9.2.0)
> ⚡️ Preparing project...
> ⚡️ Project is ready
> ⚡️ Building project...
> ▲  npm
> ▲  verb cli /usr/bin/node /usr/share/nodejs/npm/bin/npm-cli.js
> ▲  npm info using [email protected]
> ▲  npm info
> ▲  using [email protected]
> ▲  npm verb
> ▲  title npm exec vercel build
> ▲  npm verb argv "exec" "--" "vercel" "build"
> ▲  npm verb logfile logs-max:10 dir:/home/natel/.npm/_logs/2024-07-11T19_03_39_040Z-
> ▲  npm verb logfile /home/natel/.npm/_logs/2024-07-11T19_03_39_040Z-debug-0.log
> ▲  Vercel CLI 34.3.1
> ▲  WARNING: You should not upload the `.next` directory.
> ▲  Installing dependencies...
> ▲  npm
> ▲  verb cli /usr/bin/node /usr/bin/npm
> ▲  npm info using [email protected]
> ▲  npm info
> ▲  using [email protected]
> ▲  npm verb title npm install
> ▲  npm verb argv "install" "--no-audit" "--unsafe-perm"
> ▲  npm verb logfile logs-max:10 dir:/home/natel/.npm/_logs/2024-07-11T19_03_43_107Z-
> ▲  npm verb logfile /home/natel/.npm/_logs/2024-07-11T19_03_43_107Z-debug-0.log
> ▲  npm verb shrinkwrap
> ▲  failed to load node_modules/.package-lock.json out of date, updated: node_modules/prisma
> ▲  npm verb reify
> ▲  failed optional dependency /mnt/project/node_modules/fsevents
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-windows-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-windows-32
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-sunos-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-openbsd-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-netbsd-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-linux-s390x
> ▲  npm
> ▲  verb reify failed optional dependency /mnt/project/node_modules/esbuild-linux-riscv64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-linux-ppc64le
> ▲  npm verb
> ▲  reify failed optional dependency /mnt/project/node_modules/esbuild-linux-mips64le
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-linux-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-linux-arm
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-linux-32
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-freebsd-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-freebsd-64
> ▲  npm verb
> ▲  reify failed optional dependency /mnt/project/node_modules/esbuild-darwin-arm64
> ▲  npm
> ▲  verb reify failed optional dependency /mnt/project/node_modules/esbuild-darwin-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-android-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/esbuild-android-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@next/swc-win32-ia32-msvc
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@next/swc-win32-arm64-msvc
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@next/swc-linux-arm64-musl
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@next/swc-linux-arm64-gnu
> ▲  npm
> ▲  verb reify failed optional dependency /mnt/project/node_modules/@next/swc-darwin-x64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@next/swc-darwin-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/win32-ia32
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/win32-arm64
> ▲  npm
> ▲  verb reify failed optional dependency /mnt/project/node_modules/@esbuild/sunos-x64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/openbsd-x64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/netbsd-x64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-s390x
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-riscv64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-ppc64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-mips64el
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-loong64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-ia32
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/linux-arm
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/freebsd-x64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/freebsd-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/darwin-x64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/darwin-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/android-x64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/android-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@esbuild/android-arm
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/workerd-linux-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/workerd-darwin-arm64
> ▲  npm verb
> ▲  reify failed optional dependency /mnt/project/node_modules/@cloudflare/workerd-darwin-64
> ▲  npm verb reify
> ▲  failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-windows-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-windows-32
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-sunos-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-openbsd-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-netbsd-64
> ▲  npm verb
> ▲  reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-linux-s390x
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-linux-riscv64
> ▲  npm verb
> ▲  reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-linux-ppc64le
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-linux-mips64le
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-linux-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-linux-arm
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-linux-32
> ▲  npm verb
> ▲  reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-freebsd-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-freebsd-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-darwin-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-darwin-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-android-arm64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/@cloudflare/next-on-pages/node_modules/esbuild-android-64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/wrangler/node_modules/@esbuild/linux-loong64
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/wrangler/node_modules/@esbuild/android-arm
> ▲  npm verb reify failed optional dependency /mnt/project/node_modules/vercel/node_modules/fsevents
> ▲  > [email protected] postinstall
> ▲  > npx prisma generate
> ▲  npm
> ▲  verb cli /usr/bin/node /usr/share/nodejs/npm/bin/npm-cli.js
> ▲  npm info using [email protected]
> ▲  npm
> ▲  info
> ▲  using [email protected]
> ▲  npm
> ▲  verb title npm exec prisma generate
> ▲  npm verb
> ▲  argv "exec" "--" "prisma" "generate"
> ▲  npm verb logfile logs-max:10 dir:/home/natel/.npm/_logs/2024-07-11T19_03_45_680Z-
> ▲  npm verb logfile /home/natel/.npm/_logs/2024-07-11T19_03_45_680Z-debug-0.log
> ▲  Prisma schema loaded from prisma/schema.prisma
> ▲  ✔ Generated Prisma Client (v5.16.2) to ./node_modules/@prisma/client in 470ms
> ▲
> ▲  Start using Prisma Client
> ▲  ```
> ▲  import { PrismaClient } from '@prisma/client'
> ▲  const prisma = new PrismaClient()
> ▲  ```
> ▲
> ▲  More information: https://pris.ly/d/client
> ▲
> ▲  ┌─────────────────────────────────────────────────────────────┐
> ▲  │  Deploying your app to serverless or edge functions?        │
> ▲  │  Try Prisma Accelerate for connection pooling and caching.  │
> ▲  │  https://pris.ly/cli/--accelerate                           │
> ▲  └─────────────────────────────────────────────────────────────┘
> ▲  npm verb exit 0
> ▲  npm info ok
> ▲  up to date in 5s
> ▲  164 packages are looking for funding
> ▲  run `npm fund` for details
> ▲  npm verb exit 0
> ▲  npm
> ▲  info ok
> ▲  Detected Next.js version: 14.2.5
> ▲  Detected `package-lock.json` generated by npm 7+
> ▲  Running "npm run build"
> ▲  npm
> ▲  verb cli /usr/bin/node /usr/bin/npm
> ▲  npm info using [email protected]
> ▲  npm info
> ▲  using [email protected]
> ▲  npm
> ▲  verb title npm run build
> ▲  npm verb
> ▲  argv "run" "build"
> ▲  npm verb logfile logs-max:10 dir:/home/natel/.npm/_logs/2024-07-11T19_03_48_539Z-
> ▲  npm verb logfile /home/natel/.npm/_logs/2024-07-11T19_03_48_539Z-debug-0.log
> ▲  > [email protected] build
> ▲  > next build
> ▲  ▲ Next.js 14.2.5
> ▲
> ▲  Creating an optimized production build ...
> ▲  ✓ Compiled successfully
> ▲  Linting and checking validity of types ...
> ▲  Collecting page data ...
> ▲  ⚠ Using edge runtime on a page currently disables static generation for that page
> ▲  Generating static pages (0/3) ...
> ▲  ✓ Generating static pages (3/3)
> ▲  Finalizing page optimization ...
> ▲  Collecting build traces ...
> ▲
> ▲  Route (app)                                          Size     First Load JS
> ▲  ┌ ƒ /                                                164 B          87.3 kB
> ▲  ├ ƒ /_not-found                                      164 B          87.3 kB
> ▲  ├ ƒ /admin                                           164 B          87.3 kB
> ▲  ├ ƒ /admin/auditions/[showId]                        5.64 kB         164 kB
> ▲  ├ ƒ /admin/bios/[showId]                             3.01 kB         161 kB
> ▲  ├ ƒ /admin/contactsheet/[showId]                     907 B            88 kB
> ▲  ├ ƒ /admin/permissions                               2.35 kB         141 kB
> ▲  ├ ƒ /admin/reports                                   164 B          87.3 kB
> ▲  ├ ƒ /admin/roles/[[...showId]]                       3.59 kB         142 kB
> ▲  ├ ƒ /admin/shows                                     4.28 kB         162 kB
> ▲  ├ ƒ /admin/users                                     5.17 kB         163 kB
> ▲  ├ ƒ /admin/volunteerroles/[showId]                   3.22 kB         142 kB
> ▲  ├ ƒ /api/auth/[...nextauth]                          0 B                0 B
> ▲  ├ ƒ /api/roles                                       0 B                0 B
> ▲  ├ ƒ /api/shows                                       0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]                              0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/audition                     0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/audition/[studentId]         0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/auditions                    0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/bios                         0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/bios/[userId]                0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/calendar                     0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/roles                        0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/showroles/[roleId]/[userId]  0 B                0 B
> ▲  ├ ƒ /api/shows/[showId]/techsignup                   0 B                0 B
> ▲  ├ ƒ /api/shows/current                               0 B                0 B
> ▲  ├ ƒ /api/user/[userId]                               0 B                0 B
> ▲  ├ ƒ /api/user/invite                                 0 B                0 B
> ▲  ├ ƒ /api/user/signup                                 0 B                0 B
> ▲  ├ ƒ /api/user/signup/[id]                            0 B                0 B
> ▲  ├ ƒ /audition                                        3.15 kB         161 kB
> ▲  ├ ƒ /audition/success                                164 B          87.3 kB
> ▲  ├ ƒ /login                                           164 B          87.3 kB
> ▲  ├ ƒ /logout                                          163 B          87.3 kB
> ▲  ├ ƒ /profile                                         2.38 kB         102 kB
> ▲  ├ ƒ /show                                            164 B          87.3 kB
> ▲  ├ ƒ /show/bio                                        2.41 kB         161 kB
> ▲  ├ ƒ /show/castlist                                   743 B          87.9 kB
> ▲  ├ ƒ /show/volunteer                                  3.16 kB         142 kB
> ▲  ├ ƒ /signup                                          4.24 kB         146 kB
> ▲  ├ ƒ /signup/about                                    1.03 kB         101 kB
> ▲  ├ ƒ /signup/finish                                   164 B          87.3 kB
> ▲  ├ ƒ /signup/parent                                   903 B           146 kB
> ▲  └ ƒ /signup/student                                  934 B           146 kB
> ▲  + First Load JS shared by all                        87.1 kB
> ▲  ├ chunks/526-64c6322acc4228b2.js                   31.6 kB
> ▲  ├ chunks/fd9d1056-ab34c281c4857cd7.js              53.7 kB
> ▲  └ other shared chunks (total)                      1.9 kB
> ▲
> ▲
> ▲  ƒ Middleware                                         136 kB
> ▲  ƒ  (Dynamic)  server-rendered on demand
> ▲  npm
> ▲  verb exit 0
> ▲  npm info ok
> ▲  Traced Next.js server files in: 1.111s
> ▲  Created all serverless functions in: 171.393ms
> ▲  Collected static files (public/, static/, .next/static): 44.174ms
> ▲  Build Completed in .vercel/output [2m]
> ▲  npm verb exit 0
> ▲  npm info ok
> ⚡️ Completed `npx vercel build`.
> ⚡️ Unexpected error: The "path" argument must be of type string. Received undefined

This happens both when buidling locally and when buidling on cloudflare pages. npx next dev works and launches app.

Reproduction

I was able to determine that this occurred due to all of my routes being edge functions.

Pages Deployment Method

Pages CI (GitHub/GitLab integration)

Pages Deployment ID

All attempted deployments have failed

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@NBandNB NBandNB added the bug Something isn't working label Jul 11, 2024
@james-elicx
Copy link
Contributor

james-elicx commented Jul 12, 2024

Are you able to share a minimal reproduction repo?

@NBandNB
Copy link
Author

NBandNB commented Jul 12, 2024

I tried to. After further invesitigation it seems that the issue was a bug in my code that was not resulting in an error properly and was instead resulting in the next-on-pages throwing an error.

@NBandNB NBandNB closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants