You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build using npx @cloudflare/next-on-pages failing when wasm modules are imported within the app.
I have imported modules (wasm/photon/index.ts and wasm/png/index.ts) in app/api/image/route.ts which imports wasm internally.
Everything works as expected in local development using next dev.
But when we try to build it for cloudflare pages using npx @cloudflare/next-on-pages, it shows the following error:
⚡️ @cloudflare/next-on-pages CLI v.1.9.0
⚡️ Detected Package Manager: npm (10.4.0)
⚡️ Preparing project...
⚡️ Project is ready
⚡️ Building project...
▲ Vercel CLI 33.4.1
▲ WARNING: You should not upload the `.next` directory.
▲ Installing dependencies...
▲ up to date in 587ms
▲ 28 packages are looking for funding
▲ run `npm fund` for details
▲ Detected Next.js version: 14.0.4
▲ Detected `package-lock.json` generated by npm 7+
▲ Running "npm run build"
▲ > [email protected] build
▲ > next build
▲ ▲ Next.js 14.0.4
▲ 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/4) ...
▲ Generating static pages (1/4)
▲ Generating static pages (2/4)
▲ Generating static pages (3/4)
▲ ✓ Generating static pages (4/4)
▲ Finalizing page optimization ...
▲ Collecting build traces ...
▲
▲ Route (app) Size First Load JS
▲ ┌ ○ / 335 B 82.2 kB
▲ ├ ℇ /_not-found 0 B 0 B
▲ ├ ℇ /api/hello 0 B 0 B
▲ ├ ℇ /api/image 0 B 0 B
▲ ├ ℇ /client 620 B 82.5 kB
▲ └ ℇ /server 141 B 82 kB
▲ + First Load JS shared by all 81.9 kB
▲ ├ chunks/993-25f0712dd7de98d2.js 26.7 kB
▲ ├ chunks/fd9d1056-735d320b4b8745cb.js 53.3 kB
▲ ├ chunks/main-app-f0368426e1af5d32.js 242 B
▲ └ chunks/webpack-3b5a3d1c5cd9ecf8.js 1.69 kB
▲ ○ (Static) prerendered as static content
▲ ℇ (Edge Runtime) server-rendered on demand using the Edge Runtime
▲ Traced Next.js server files in: 501.244ms
▲ Created all serverless functions in: 858.896ms
▲ Collected static files (public/, static/, .next/static): 5.552ms
▲ Build Completed in .vercel/output [21s]
⚡️ Completed `npx vercel build`.
⚡️ Unexpected error: ENOENT: no such file or directory, copyfile '/home/deo/Pages/next-on-pages-get-request-context-test-demo/.vercel/output/functions/api/image.func/wasm/wasm_65d5384f60effcb9a86d814043fa7bb1fdd99f0b.wasm' -> '/home/deo/Pages/next-on-pages-get-request-context-test-demo/.vercel/output/static/_worker.js/__next-on-pages-dist__/wasm/wasm_65d5384f60effcb9a86d814043fa7bb1fdd99f0b.wasm'
next-on-pages environment related information
Description
The build using
npx @cloudflare/next-on-pages
failing when wasm modules are imported within the app.I have imported modules (
wasm/photon/index.ts
andwasm/png/index.ts
) inapp/api/image/route.ts
which imports wasm internally.Everything works as expected in local development using
next dev
.But when we try to build it for cloudflare pages using
npx @cloudflare/next-on-pages
, it shows the following error:Reproduction
@cloudflare/next-on-pages
(shows error):Pages Deployment Method
None
Pages Deployment ID
Not yet deployed
Additional Information
Note that the build is successful when routes which import wasm are removed/deleted.
Would you like to help?
The text was updated successfully, but these errors were encountered: