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: updated agent to create a stub api when running in a worker thread #1800

Merged
merged 1 commit into from Oct 9, 2023

Conversation

bizob2828
Copy link
Member

Description

Apparently Next.js does not like early returns in CommonJS files, even though it's valid syntax. This PR updates it to return a stub API in that case, effectively doing nothing but without an early return

Links

Closes #1783

…ad instead of exiting early to appease the Next.js gods
@mrickard mrickard self-assigned this Oct 9, 2023
@bizob2828 bizob2828 merged commit 636e8f0 into newrelic:main Oct 9, 2023
26 checks passed
Node.js Engineering Board automation moved this from Needs PR Review to Done: Issues recently completed Oct 9, 2023
@github-actions github-actions bot mentioned this pull request Oct 11, 2023
@tomchentw
Copy link

Thank you and the wonderful NewRelic team for the release. newrelic@11.2.0 did fixed this issue.


I was able to use newrelic@11.2.0 along with next@13.4.9 on the App Router. You will need to enable this config:
https://nextjs.org/docs/app/api-reference/next-config-js/serverComponentsExternalPackages

export default {
  experimental: {
    appDir: true,
    serverComponentsExternalPackages: ["newrelic"], // without this, you will see this Error: Cannot find module './stub_api'
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Node.js Engineering Board
  
Done: Issues recently completed
Development

Successfully merging this pull request may close these issues.

Top level return statements
3 participants