Skip to content

Cannot run vitest if there's a Link component inside a deeply nested component #3470

@xeoneux

Description

@xeoneux

Which project does this relate to?

Router

Describe the bug

I am not able to run tests using vitest if a nested component has the Link component
The error I'm getting is Error: Invariant failed: Could not find a nearest match!

Your Example Website or App

https://stackblitz.com/edit/github-qqnqjkea

Steps to Reproduce the Bug or Issue

https://stackblitz.com/edit/github-qqnqjkea

Expected behavior

The test should run without causing the above-mentioned error

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: happy-dom

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions