Skip to content

Context conflict when running multiple projects with nuxt-vitest #537

Open
nuxt/nuxt
#30510
@TECH7Fox

Description

I have a monorepo with a nuxt 3 app and multiple nuxt modules. The nuxt 3 app already has nuxt-vitest tests and it works great with the new RootDir option. But when I try to add nuxt-vitest to a module in the monorepo, it fails with this error:

> vitest --ui --coverage

failed to load config from /home/jordy/repositories/my_repo/packages/my_package/vitest.config.ts
Error: Context conflict
 ❯ checkConflict node_modules/unctx/dist/index.mjs:6:13
 ❯ Object.set node_modules/unctx/dist/index.mjs:40:9
 ❯ initNuxt node_modules/nuxt/dist/index.mjs:2689:11
 ❯ Object.ready node_modules/nuxt/dist/index.mjs:2680:18
 ❯ loadNuxt node_modules/nuxt/dist/index.mjs:2989:16
 ❯ loadNuxt node_modules/@nuxt/kit/dist/index.mjs:534:19
 ❯ startNuxtAndGetViteConfig node_modules/nuxt-vitest/dist/config.mjs:8:16
 ❯ getVitestConfigFromNuxt node_modules/nuxt-vitest/dist/config.mjs:48:15

On their own it works, it's only when running the global vitest workspace, which has all the coverage and UI in one place.

Not sure how to fix this.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions