Skip to content

cy.intercept does not work for vite 5 #29891

Open
@Ofenlord

Description

@Ofenlord

Current behavior

Requests cannot be intercepted if you use vite v5 and have to set the following property for the dev server due to the workaround for the public folder: devServerPublicPathRoute: '' . This happens for component tests.
It doesn't matter if the fetch request uses relative or absolute url's.
image
image

Desired behavior

Cypress should intercept the request like before with vite v4. If you do not set devServerPublicPathRoute, the interception of requests will work. So it must be related to this. However, for me it is not an option to omit this property, because in our software I need some relative paths to the public folder used within shadow roots.

Test code to reproduce

modules:

  • vite 5.3.4
  • cypress 13.13.1

Cypress Version

13.13.1

Node version

v22.2.0

Operating System

Windows 11

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CTIssue related to component testingstage: needs informationNot enough info to reproduce the issuestaleno activity on this issue for a long period

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions