next-on-pages: [🐛 Bug]: favicon.ico.func were not configured to run with the Edge Runtime

next-on-pages environment related information

⚡️ @cloudflare/next-on-pages CLI ⚡️ Preparing project for ‘npx vercel build’… ⚡️ Project ready for ‘npx vercel build’… ⚡️ ⚡️ Building project with ‘npx vercel build’… ▲ Vercel CLI 28.20.0 ▲ WARNING: You should not upload the .next directory. ▲ Installing dependencies… ▲ up to date in 2s ▲ ▲ 10 packages are looking for funding ▲ run npm fund for details ▲ Detected Next.js version: 13.4.2 ▲ Detected package-lock.json generated by npm 7+… ▲ Running “npm run build” ▲ > my-next-app@0.1.0 build ▲ > next build ▲ - info Loaded env from /home/zizifn/github/myTrash/.env.local ▲ - warn You have enabled experimental feature (serverActions) in next.config.js. ▲ - warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk. ▲ - info Creating an optimized production build… ▲ - info Compiled successfully ▲ - info Linting and checking validity of types… ▲ ./src/app/nav-bar.tsx ▲ 21:19 Warning: Using <img> could result in slower LCP and higher bandwidth. Consider using <Image /> from next/image to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element ▲ 26:19 Warning: Using <img> could result in slower LCP and higher bandwidth. Consider using <Image /> from next/image to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element ▲ 69:23 Warning: Using <img> could result in slower LCP and higher bandwidth. Consider using <Image /> from next/image to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element ▲ 178:19 Warning: Using <img> could result in slower LCP and higher bandwidth. Consider using <Image /> from next/image to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element ▲ ▲ ./src/components/client-redirect.tsx ▲ 14:6 Warning: React Hook useEffect has a missing dependency: ‘push’. Either include it or remove the dependency array. react-hooks/exhaustive-deps ▲ ▲ info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules ▲ - info Collecting page data… ▲ - info Generating static pages (0/3) ▲ - info Generating static pages (3/3) ▲ - info Finalizing page optimization… ▲ ▲ Route (app) Size First Load JS ▲ ┌ ℇ / 4.85 kB 84.3 kB ▲ ├ ℇ /actions 144 B 79.5 kB ▲ ├ ℇ /api/hello 0 B 0 B ▲ ├ ℇ /api/login 0 B 0 B ▲ ├ ℇ /api/mock/d1 0 B 0 B ▲ ├ ℇ /api/mock/kv 0 B 0 B ▲ ├ ℇ /api/vpn/[type]/[uuid] 0 B 0 B ▲ ├ ℇ /api/ws 0 B 0 B ▲ ├ ○ /favicon.ico 0 B 0 B ▲ ├ ℇ /pg-nextjs/clientsearch 903 B 80.3 kB ▲ ├ ℇ /pg-nextjs/serversearch 905 B 80.3 kB ▲ ├ ℇ /playground 1.29 kB 91.2 kB ▲ └ ℇ /vpn 144 B 79.5 kB ▲ + First Load JS shared by all 79.4 kB ▲ ├ chunks/474-43d4723ec0a94de2.js 24.8 kB ▲ ├ chunks/b7dfe19b-f50f98df0e92e975.js 52.7 kB ▲ ├ chunks/main-app-43de51b9b51a236b.js 210 B ▲ └ chunks/webpack-8c83a44ea16bce0b.js 1.71 kB ▲ ▲ Route (pages) Size First Load JS ▲ ─ ○ /404 179 B 88.4 kB ▲ + First Load JS shared by all 88.2 kB ▲ ├ chunks/main-6da9f4eb766771ef.js 86.3 kB ▲ ├ chunks/pages/_app-c717e47bb95cec4a.js 192 B ▲ └ chunks/webpack-8c83a44ea16bce0b.js 1.71 kB ▲ ℇ (Streaming) server-side renders with streaming (uses React 18 SSR streaming or Server Components) ▲ ○ (Static) automatically rendered as static HTML (uses no initial props) ▲ Traced Next.js server files in: 2.722s ▲ Created all serverless functions in: 3.489s ▲ Collected static files (public/, static/, .next/static): 5.92ms ▲ Build Completed in .vercel/output [26s] ⚡️ Completed npx vercel build. ⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project. ⚡️ ⚡️ The following functions were not configured to run with the Edge Runtime: ⚡️ - favicon.ico.func ⚡️ ⚡️ If this is a Next.js project: ⚡️ ⚡️ - you can read more about configuring Edge API Routes here: https://nextjs.org/docs/api-routes/edge-api-route ⚡️ ⚡️ - you can try enabling the Edge Runtime for a specific page by exporting the following from your page: ⚡️ ⚡️ export const config = { runtime: ‘edge’ }; ⚡️ ⚡️ - or you can try enabling the Edge Runtime for all pages in your project by adding the following to your ‘next.config.js’ file: ⚡️ ⚡️ const nextConfig = { experimental: { runtime: ‘edge’} }; ⚡️ ⚡️ You can read more about the Edge Runtime here: https://nextjs.org/docs/advanced-features/react-18/switchable-runtime

Description

I think something wrong with the new prerelease build(0.0.0-c70151d) with nextjs 13.4 for favicon.ico.func? There is no way to setup export const runtime = "edge"; for favicon…

Reproduction

I think any project with a prerelease build with nextjs 13.4 can reproduction this. If not, you can use my repo https://github.com/zizifn/myTrash

Pages Deployment Method

Pages CI (GitHub/GitLab integration)

Pages Deployment ID

da22e8f7-04f8-4568-9924-e48f213d7d2b

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 18 (10 by maintainers)

Most upvoted comments

It is quite bad that this prevents you from using D1… 😓

However I am pretty sure that this is something that needs to be fixed in wrangler and not next-on-pages (I believe it’s caused by a bug in the newly introduced _wrangler.js dir implementation which we use)

It does really limit the use of next-on-pages, I’ll try to push for a fix, thanks a lot for reporting this! 🙏

PS: I think we should have a new issue here to keep track of this, please let me know if you want to open it or if you prefer that I do that 🙂

please do what you think is best, I’m fine… Just ping me the issue ID, I will watch it… 😃

@zizifn never mind, I got it 👍

Screenshot at 2023-05-14 15-49-17

BTW, deleted D1 binding in the dashboard and changing any file in the repo, new CI deployment will be back to normal… I tried many times.

@zizifn never mind, I got it 👍

Screenshot at 2023-05-14 15-49-17

Thanks for checking this!! I deleted my page project and create a new one… CI deployment is success… No idea why… But my nextjs on pages is running, will play around…

That’s strange… I’m glad to hear your deployment is working now though!

Hi @zizifn thank you very much for the issue 🙂

This is a known issue and we do have this function that should address it 😕 https://github.com/cloudflare/next-on-pages/blob/c70151dcbfa4bb7886884364fc98e4d696285278/src/buildApplication/generateFunctionsMap.ts#L432

Something might have changed and caused the function not to get run anymore or not fix the issue 😓 I’ll have a look 👍