test(vue/e2e): Add tests for Vue UI spans - #24001
Merged
Merged
Conversation
s1gr1d
requested review from
chargome and
mydea
and removed request for
a team
September 3, 2026 11:58
chargome
approved these changes
Sep 3, 2026
| await page.goto(`/client-error`); | ||
|
|
||
| const rootSpan = await transactionPromise; | ||
| const uiSpans = rootSpan.spans.filter(span => span.origin === 'auto.ui.vue'); |
Contributor
There was a problem hiding this comment.
Bug: The code accesses rootSpan.spans.filter(...) without a null guard, but spans is an optional property. This could cause a TypeError if spans is undefined.
Severity: LOW
Suggested Fix
To improve test robustness, add a null guard before accessing the spans property. Change the access from rootSpan.spans.filter(...) to (rootSpan.spans || []).filter(...). This ensures that if spans is undefined, the code will operate on an empty array instead of throwing an error.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
dev-packages/e2e-tests/test-applications/nuxt-4/tests/tracing.client.test.ts#L80
Potential issue: The `Event` interface defines the `spans` property as optional.
However, the test code accesses `rootSpan.spans.filter(...)` without a null check. If a
transaction event is processed that does not have any spans, the `spans` property will
be `undefined`, leading to a `TypeError` when the `.filter` method is called. While the
current test configuration is expected to always generate spans, this lack of a
defensive guard makes the test fragile and inconsistent with other tests in the codebase
that use `(rootSpan.spans || [])` to safely handle this case.
Also affects:
dev-packages/e2e-tests/test-applications/nuxt-5/tests/tracing.client.test.ts:114
Did we get this right? 👍 / 👎 to inform future reviews.
Contributor
size-limit report 📦
|
s1gr1d
force-pushed
the
sig/vue-no-mixins
branch
from
September 3, 2026 12:34
214be84 to
8106f32
Compare
s1gr1d
enabled auto-merge (squash)
September 3, 2026 12:46
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Nuxt 5 disables Vue's Options API by default (nuxt/nuxt#35791), which turns
app.mixin()into a silent no-op.Before we replace the mixin with a runtime mechanism, this PR pins down what it does today, so the replacement can be proven behavior-preserving. No SDK code changes.
create,update,activate), and that spans are keyed by operation.Application Render,Vue <Root>).vue: { optionsApi: true }escape hatch, so it now shows the Nuxt 5 default (tests are markedtest.fail)Reference: #23375