fix (docs): Laminar observability - add note on next.config #6248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Like many other OpenTelemetry instrumentations, Laminar depends on
@opentelemetry/instrumentation
, which, in turn, depends onrequire-in-the-middle
andimport-in-the-middle
. Importing and initializing Laminar inside Next.jsinstrumentation.ts
file causes Next.js to try resolving these two packages, but fails, and results in:@vercel/otel
can set theirs).We have tried many different things to debug, including bundling Laminar differently, shipping those two packages within Laminar as
noExternal
, adding a separate entrypoint in our package for Next.js, but nothing seems to have worked.The only thing that's worked was adding
@lmnr-ai/lmnr
inserverExternalPackages
in next.config.Example error message without turbopack:
Example error message with Turbopack
Summary
Add a subsection within the Next.js section that describes
Verification
Syntax highlighter for MDX
Tasks
pnpm changeset
in the project root)pnpm prettier-fix
in the project root)Future Work
Related Issues