Skip to content

fix(nuxt): Skip 3xx/4xx Nuxt errors in the vue:error hook - #25341

Merged
s1gr1d merged 2 commits into
getsentry:developfrom
mketiku:fix/nuxt-ignore-4xx-vue-error
Oct 14, 2026
Merged

s1gr1d merged 2 commits into
getsentry:developfrom
mketiku:fix/nuxt-ignore-4xx-vue-error

Conversation

@mketiku

@mketiku mketiku commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Description

#15473 stopped the client plugin from reporting Nuxt errors with a 3xx/4xx status in its app:error hook. Nuxt also calls vue:error for every error that reaches the root component, fatal or not, so a page that throws createError({ statusCode: 404 }) during setup is still reported, from the vue:error handler (mechanism auto.function.nuxt.vue-error). On client-side navigation this happens for every such 404.

This applies the same check to both hooks through a shared isIgnoredNuxtError, and adds unit tests for the client plugin's error hooks: 3xx/4xx Nuxt errors are skipped from both hooks, 5xx Nuxt errors and non-Nuxt errors are still reported. Without the fix, the vue:error 4xx test fails.

@mketiku
mketiku requested a review from a team as a code owner October 13, 2026 22:12
@mketiku
mketiku requested review from nicohrubec and s1gr1d and removed request for a team October 13, 2026 22:12
@github-actions github-actions Bot added the external PR from an external contributor label Oct 13, 2026
@mketiku mketiku closed this Oct 13, 2026
@mketiku mketiku reopened this Oct 13, 2026

@s1gr1d s1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution!
The PR title reads as "300 to 400", but the check skips 300 to 499. Suggestion: fix(nuxt): Skip 3xx/4xx Nuxt errors in the vue:error hook.

Just some small nit comments

Comment thread packages/nuxt/test/runtime/plugins/client.test.ts Outdated
Comment thread packages/nuxt/src/runtime/plugins/sentry.client.ts Outdated
@mketiku mketiku changed the title fix(nuxt): Ignore 300-400 status codes on Vue errors in Nuxt fix(nuxt): Skip 3xx/4xx Nuxt errors in the vue:error hook Oct 14, 2026
@mketiku

mketiku commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I updated the title and addressed both nits in 1b3602c.

@s1gr1d
s1gr1d enabled auto-merge (squash) October 14, 2026 13:24
@s1gr1d
s1gr1d merged commit 4a9ef21 into getsentry:develop Oct 14, 2026
255 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PR from an external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants