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

feat(nextjs): Automatically resolve source of errors in dev mode #7294

Merged
merged 18 commits into from Mar 1, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Feb 28, 2023

Fixes #7286

This PR uses the Next.js dev server to resolve source maps in dev mode, eliminating the need to update them.

Before

image

After

Screenshot 2023-02-28 at 16 29 11

@github-actions
Copy link
Contributor

github-actions bot commented Feb 28, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.11 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.49 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.74 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 55.5 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.48 KB (0%)
@sentry/browser - Webpack (minified) 66.94 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.51 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.05 KB (+0.03% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.04 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.29 KB (+0.01% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.86 KB (+0.01% 🔺)
@sentry/replay - Webpack (gzipped + minified) 36.94 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.45 KB (+0.01% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 53.99 KB (+0.01% 🔺)

@lforst lforst changed the title feat(nextjs): Automatically resolve errors happening in dev mode feat(nextjs): Automatically resolve source of errors in dev mode Feb 28, 2023
@lforst lforst marked this pull request as ready for review February 28, 2023 15:35
@lforst lforst requested review from Lms24 and mydea February 28, 2023 15:58
@@ -13,18 +19,18 @@ const config: PlaywrightTestConfig = {
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000,
timeout: 10000,
},
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Should we update this comment as well?

return;
}

test('should have symbaolicated dev errors', async ({ page }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test('should have symbaolicated dev errors', async ({ page }) => {
test('should have symbolicated dev errors', async ({ page }) => {

small typo ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might have been hungry

* in the dev overlay.
*/
export async function devErrorSymbolicationEventProcessor(event: Event, hint: EventHint): Promise<Event | null> {
// Do to changes across Next.js versions, there are a million things that can go wrong here so we just try-catch the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Do to changes across Next.js versions, there are a million things that can go wrong here so we just try-catch the
// Due to changes across Next.js versions, there are a million things that can go wrong here so we just try-catch the

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! The regex is a bit 😬 but since it's only for dev that's fine. Cool improvement!

@lforst lforst merged commit 72cb01f into develop Mar 1, 2023
@lforst lforst deleted the lforst-nextjs-resolve-dev-errors branch March 1, 2023 15:34
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.

Send symbolicated stack traces in Next.js dev mode
3 participants