You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a very interesting setup but unfortunately seems needed and it works in my application.
I need to define a page in a nuxt app, that has to have a layout, and then in this layout I read a variable from a global store to find out which layout is needed dynamically, and then use the NuxtLayout component again but with a prop defining the name. This causes a circular dependency for tests, but it is not actually circular.
I think there could be better checks or a way to define a circular limit counter before throwing the error.
And although - virtual:nuxt:/Users/danielwest/Documents/GitHub/_CWA/cwa-nuxt-3-module/.nuxt/layouts.mjs is hit again, the next dependency would NOT be /Users/danielwest/Documents/GitHub/_CWA/cwa-nuxt-3-module/src/layer/layouts/cwa-root-layout.vue due to the prop being passed to it.
Describe the bug
I have a very interesting setup but unfortunately seems needed and it works in my application.
I need to define a page in a nuxt app, that has to have a layout, and then in this layout I read a variable from a global store to find out which layout is needed dynamically, and then use the
NuxtLayout
component again but with a prop defining the name. This causes a circular dependency for tests, but it is not actually circular.I think there could be better checks or a way to define a circular limit counter before throwing the error.
The Error I get is:
And although
- virtual:nuxt:/Users/danielwest/Documents/GitHub/_CWA/cwa-nuxt-3-module/.nuxt/layouts.mjs
is hit again, the next dependency would NOT be/Users/danielwest/Documents/GitHub/_CWA/cwa-nuxt-3-module/src/layer/layouts/cwa-root-layout.vue
due to the prop being passed to it.The check is performed here:
https://github.com/vitest-dev/vitest/blob/main/packages/vite-node/src/client.ts#L196
Reproduction
Root layout configured to be loaded from the Nuxt page
And the default layout passed if the other is unavailable
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: