- Notifications
You must be signed in to change notification settings - Fork3.4k
Components that import modules with path aliases fail to mount#31029
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
We are using Nuxt 3.15.2 with Vite and Vue. Nuxt/Vite configures path aliases for '@' and '~' that work fine when run normally. Those aliases are not recognized when mounting a component with Cypress. An answer to a question previously posted on this site suggested removing 'viteConfig' from the component section of the cypress config file and configuring the needed aliases in one of several vite config files as follows.
Outside of the Nuxt environment, this works. However, Nuxt wants to own vite configuration, and complains when I create one of the vite config files suggested by Cypress. When using Nuxt to configure Vite, is there a way to tell Cypress component tests how to translate the aliases? |
BetaWas this translation helpful?Give feedback.