opennextjs / opennextjs-cloudflare

Open Next.js adapter for Cloudflare
https://opennext.js.org/cloudflare
MIT License
279 stars 6 forks source link

Incompatible with Next.js 15 canary #61

Open denolfe opened 1 week ago

denolfe commented 1 week ago

Hey All, we at Payload are extremely excited about getting this to work with our platform. People are asking about running Payload on Cloudflare quite often, and there is a lot of potential here.

Payload's version 3 is now built on Next.js but is still in beta and thus requires Next.js v15.0.0-canary.173 or higher.

We followed the getting started docs here, then attempted to upgrade to the latest Next.js + React versions and received the following errors:

/Users/elliot/dev/sandbox/my-next-app/node_modules/.pnpm/wrangler@3.80.0_@cloudflare+workers-types@4.20241004.0/node_modules/wrangler/wrangler-dist/cli.js:29768
            throw a;
            ^
{
  type: 'error',
  reason: 'Failed to construct initial bundle',
  cause: UserError: Failed to build
      at bundleWorker (/Users/elliot/dev/sandbox/my-next-app/node_modules/.pnpm/wrangler@3.80.0_@cloudflare+workers-types@4.20241004.0/node_modules/wrangler/wrangler-dist/cli.js:165378:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async build (/Users/elliot/dev/sandbox/my-next-app/node_modules/.pnpm/wrangler@3.80.0_@cloudflare+workers-types@4.20241004.0/node_modules/wrangler/wrangler-dist/cli.js:175368:59),
  source: 'BundlerController',
  data: undefined
}

We realize we're on the cutting edge here, but we're very excited to try this out. We'd like to know when we should try again.

vicb commented 1 week ago

Supporting v15 is definitely on our radar but not before the official release.

Our priority for now is to converge with Open Next/SST. It will enable moving faster in the future.

sourabpramanik commented 1 week ago

I am also trying to deploy the Payload 3.0 app which uses Next 15. I am able to build the app using wrangler successfully, just that when running the local server it throws errors.

Here are the error logs:

--- 2024-10-09T05:11:35.740Z debug
[InspectorProxyWorker] RUNTIME INCOMING MESSAGE {
  method: 'Runtime.consoleAPICalled',
  params: {
    type: 'error',
    args: [ [Object], [Object] ],
    executionContextId: 283096929,
    timestamp: 1728450695732,
    stackTrace: { callFrames: [Array] }
  }
}
---

--- 2024-10-09T05:11:42.559Z error
✘ [ERROR] Failed to prepare server Error: An error occurred while loading the instrumentation hook