Skip to content
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

fix(nextjs): Handle CJS API route exports #5865

Merged

Conversation

lforst
Copy link
Member

@lforst lforst commented Oct 1, 2022

Fixes #5863

The PR makes our auto wrapping of Next.js API routes able to handle CJS exports. Previously we only looked at import.default which is not defined in case the user exported via CJS export (e.g. module.exports = myFunction;)

@lforst lforst merged commit b7c0e54 into master Oct 3, 2022
@lforst lforst deleted the lforst-fix-nextjs-cjs-exported-api-routes-magic-wrapping branch October 3, 2022 07:39
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.

autoInstrumentServerFunctions breaks when the API route has a CJS export
2 participants