-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(nextjs): Use Edge SDK for Edge bundles #6753
Conversation
size-limit report 📦
|
@@ -348,7 +350,7 @@ async function addSentryToEntryProperty( | |||
* @param platform Either "server" or "client", so that we know which file to look for | |||
* @returns The name of the relevant file. If no file is found, this method throws an error. | |||
*/ | |||
export function getUserConfigFile(projectDir: string, platform: 'server' | 'client'): string { | |||
export function getUserConfigFile(projectDir: string, platform: 'server' | 'client' | 'edge'): string | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean users have to define a sentry.edge.config.js
?
we have to update the docstring if this is the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean users have to define a
sentry.edge.config.js
?
They don't have to in the sense that something will crash, but they should if they want to capture events. We're even logging a warning that they should add the file in case they're using edge stuff.
we have to update the docstring if this is the case.
Thanks for pointing that out. I updated the docstring.
…-for-edge-bundles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we think about updating the wizard to generate a sentry.edge.config.js
?
Most definitely! Adding a special command that auto-generates the file probably makes sense. Getting the right dsn would be difficult though but we can just put some placeholder there and print a message that instructs to replace it. |
Ref: #4206
In #6752 we added a small SDK for the Edge Runtime. This PR will inject the SDK into edge runtime bundles generated by Next.js, enabling users to call the Sentry SDK from within middleware and edge API routes. Both errors and performance will work with this change.
Testing this change is impossible with our current setup. I will create proper E2E tests when #6746 is merged.