Skip to content

build: Add node export for better compatibility #6716

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mydea
Copy link

@mydea mydea commented Jun 11, 2025

Background

On Next.js, we noticed that instrumentation via import-in-the-middle of this package was not working. After some deep debugging, I figured out that the problem seems to be that it keeps picking up the .mjs variant in Next.js, although Next itself is cjs. That seems to mess with import-in-the-middle (or actually require-in-the-middle, I suppose).

The only way to fix this and get it to load the cjs correctly in Next.js was to add a node variant export.

Summary

Added a node variant export that points to the cjs outout.

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

Successfully merging this pull request may close these issues.

1 participant