next-on-pages icon indicating copy to clipboard operation
next-on-pages copied to clipboard

[๐Ÿ› Bug]: Instrumentation is not called on Next.js v15

Open gregberge opened this issue 10 months ago โ€ข 6 comments

next-on-pages environment related information

System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.2.0: Fri Dec 6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000 CPU: (10) arm64 Apple M1 Max Memory: 32 GB Shell: /bin/zsh Package Manager Used: npm (10.9.0)

Relevant Packages: @cloudflare/next-on-pages: 1.13.7 vercel: 37.8.0 next: 15.1.3

Description

I am from GitBook, we use Next.js on Cloudflare using next-on-pages. Here is the instrumentation.ts file.

I made lot of tests and it seems that register in instrumentation.ts is not called when running on Cloudflare, also onRequestError is not called.

Reproduction

Add instrumentation.ts, add a log in the register and onRequestError, locally you can see the log, on Cloudflare, you don't.

Pages Deployment Method

None

Pages Deployment ID

No response

Additional Information

No response

Would you like to help?

  • [ ] Would you like to help fixing this bug?

gregberge avatar Jan 09 '25 09:01 gregberge

related #678

tttttahiti avatar Jan 10 '25 04:01 tttttahiti

related #678

I mitigated this bug by downgrading Sentry, but even by doing so, the instrumentation file is not called at all. So it's two different problemd. #678 is only relative to Sentry, this one concerns anything in instrumentation.ts, even a simple log.

gregberge avatar Jan 10 '25 07:01 gregberge

Supported Next.js versions @cloudflare/next-on-pages supports all minor and patch version of Next.js 13 and 14. We regularly run manual and automated tests to ensure compatibility.

https://developers.cloudflare.com/pages/framework-guides/nextjs/ssr/supported-features/

Would like to learn when nextjs 15 will be supported

rkristelijn avatar Feb 24 '25 09:02 rkristelijn

Would like to learn when nextjs 15 will be supported

It won't be officially supported. The focus has shifted to the OpenNext adapter.

james-elicx avatar Feb 24 '25 09:02 james-elicx

Thanks for the quick response, so NextJs 15 will be supported via opennext then?

https://opennext.js.org/cloudflare

Supported Next.js versions @opennextjs/cloudflare is pre 1.0, and still in active development. We intend to support all minor and patch versions of Next.js 15 and the latest minor of Next.js 14.

rkristelijn avatar Feb 24 '25 09:02 rkristelijn

Thanks for the quick response, so NextJs 15 will be supported via opennext then?

opennext.js.org/cloudflare

Supported Next.js versions @opennextjs/cloudflare is pre 1.0, and still in active development. We intend to support all minor and patch versions of Next.js 15 and the latest minor of Next.js 14.

Yes

james-elicx avatar Feb 24 '25 10:02 james-elicx

Hello ๐Ÿ™‚ Thank you for the issue and apologies for the late reply.

Earlier this year we released our Cloudflare adapter for OpenNext, and we have been continuously investing effort in its improvement since then. Existing deployments can continue to use the next-on-pages tooling, but the Cloudflare adapter for OpenNext is currently stable and recommended for deployment of Next.js applications to Cloudflare.

As such, we will no longer be maintaining next-on-pages. We recently deprecated the package on npm and we plan to archive this repo on Monday Sep 29, 2025. In preparation for archival, we are closing all open issues and PRs.

If you have concerns, please feel free to reply here before the repo is archived (after that, it will no longer be possible to comment) or to reach out to our team on Discord.

Thanks so much for using and contributing to next-on-pages ๐Ÿงก

dario-piotrowicz avatar Sep 26 '25 23:09 dario-piotrowicz