-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(nextjs): Update stackframe calls for next v15.5 #17156
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ | |
"clean": "npx rimraf node_modules pnpm-lock.yaml", | ||
"test:prod": "TEST_ENV=production playwright test", | ||
"test:dev": "TEST_ENV=development playwright test", | ||
"test:build": "pnpm install && pnpm build", | ||
"test:build": "pnpm install && pnpm build:canary", | ||
"test:test-build": "pnpm ts-node --script-mode assert-build.ts", | ||
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm add react@beta && pnpm add react-dom@beta && pnpm build", | ||
"build:canary": "pnpm install && pnpm add next@canary && pnpm add react@beta && pnpm add react-dom@beta && pnpm build", | ||
"test:build-latest": "pnpm install && pnpm add next@latest && pnpm build", | ||
"test:build-13": "pnpm install && pnpm add [email protected] && pnpm build", | ||
"test:assert": "pnpm test:test-build && pnpm test:prod && pnpm test:dev" | ||
|
47 changes: 21 additions & 26 deletions
47
...packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,30 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForError } from '@sentry-internal/test-utils'; | ||
|
||
test.describe('dev mode error symbolification', () => { | ||
if (process.env.TEST_ENV !== 'development') { | ||
test.skip('should be skipped for non-dev mode', () => {}); | ||
return; | ||
} | ||
test('should have symbolicated dev errors', async ({ page }) => { | ||
test.skip(process.env.TEST_ENV !== 'development', 'should be skipped for non-dev mode'); | ||
|
||
test('should have symbolicated dev errors', async ({ page }) => { | ||
await page.goto('/'); | ||
await page.goto('/'); | ||
|
||
const errorEventPromise = waitForError('nextjs-app-dir', errorEvent => { | ||
return errorEvent?.exception?.values?.[0]?.value === 'Click Error'; | ||
}); | ||
const errorEventPromise = waitForError('nextjs-app-dir', errorEvent => { | ||
return errorEvent?.exception?.values?.[0]?.value === 'Click Error'; | ||
}); | ||
|
||
await page.getByText('Throw error').click(); | ||
await page.getByText('Throw error').click(); | ||
|
||
const errorEvent = await errorEventPromise; | ||
const errorEventFrames = errorEvent.exception?.values?.[0]?.stacktrace?.frames; | ||
const errorEvent = await errorEventPromise; | ||
const errorEventFrames = errorEvent.exception?.values?.[0]?.stacktrace?.frames; | ||
|
||
expect(errorEventFrames?.[errorEventFrames?.length - 1]).toEqual( | ||
expect.objectContaining({ | ||
function: 'onClick', | ||
filename: 'components/client-error-debug-tools.tsx', | ||
lineno: 54, | ||
colno: expect.any(Number), | ||
in_app: true, | ||
pre_context: [' <button', ' onClick={() => {'], | ||
context_line: " throw new Error('Click Error');", | ||
post_context: [' }}', ' >', ' Throw error'], | ||
}), | ||
); | ||
}); | ||
expect(errorEventFrames?.[errorEventFrames?.length - 1]).toEqual( | ||
expect.objectContaining({ | ||
function: 'onClick', | ||
filename: 'components/client-error-debug-tools.tsx', | ||
lineno: 54, | ||
colno: expect.any(Number), | ||
in_app: true, | ||
pre_context: [' <button', ' onClick={() => {'], | ||
context_line: " throw new Error('Click Error');", | ||
post_context: [' }}', ' >', ' Throw error'], | ||
}), | ||
); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.