Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Investigate and support Next.js instrumentation #171

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

Closed
dario-piotrowicz opened this issue Dec 12, 2024 · 4 comments · Fixed by #409
Closed

Investigate and support Next.js instrumentation #171

dario-piotrowicz opened this issue Dec 12, 2024 · 4 comments · Fixed by #409
Assignees

Comments

@dario-piotrowicz
Copy link
Contributor

dario-piotrowicz commented Dec 12, 2024

Next.js 15 introduced a loadInstrumentationModule methods that appears in our bundled worker which caused our workers to fail at runtime.

We're solved such issue by replacing the content of the loadInstrumentationModule methods with a no-op implementation (see: #169), this was the simplest and quickest way to work around the issue and unblock Next.js 15 for us, it is however most likely not the correct solution and almost certainly breaks Next.js' instrumentation.

So this issue is for investigating and understanding if and how we support instrumentation, and if we don't support it (which most likely we don't) find a way to do so.

@dario-piotrowicz dario-piotrowicz added enhancement New feature or request triage needs investigation and removed enhancement New feature or request triage labels Dec 12, 2024
@dario-piotrowicz dario-piotrowicz self-assigned this Dec 12, 2024
@Nopsled
Copy link

Nopsled commented Dec 26, 2024

As I understand, this adapter does support Next.js 15.1 now?

@dario-piotrowicz
Copy link
Contributor Author

Yes it does 🙂

Although we don't support all Next.js 15 features (like instrumentation), I don't even think we have investigated all features and understood the extent of our support

@vicb might be able to shed some light here 🙂

@hitsthings
Copy link

Apologies if this is noise, but just a vote here for prioritizing this and some context in case that is helpful.

We are having a hell of a time with instrumentation for next-on-pages and are holding out hope that OpenNext will soon solve our problems. Observability is pretty important to use in our production services and we currently aren't able to see all Sentry errors (which is a huge problem!). We are looking at workarounds with logpush and setting up alerting on our logs, but given the edge runtime requirement for next-on-pages, our other options are slim unless we move to Vercel (which I really don't want to do!) We need to know when things fail before we can ship this to customers.

Thanks for listening and for all you're doing on OpenNext!

@vicb
Copy link
Contributor

vicb commented Feb 6, 2025

I took a quick look here.

What we say in the patch

* The `loadInstrumentationModule` method (source: https://github.com/vercel/next.js/blob/5b7833e3/packages/next/src/server/next-server.ts#L301)
* calls `module.findSourceMap` (https://nodejs.org/api/module.html#modulefindsourcemappath) which we haven't implemented causing a runtime error.

is outdated as findSourceMap was implemented in unjs/unenv#349

The real issue here is a dynamicRequire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants