NuxtN
Nuxt5mo ago
5 replies
Buffet Time

Nuxt 4 Migration, have build working, tests fail

I'm working on a migration to Nuxt 4, I've done the outlined file changes to be in the ./app directory. My build work and app seems mostly fine, tests however:

Error: Cannot find module 'C:/Programming/leaderboard-site/app/vitest.setup.ts'
Caused by: Error: Failed to load url C:/Programming/leaderboard-site/app/vitest.setup.ts (resolved id: C:/Programming/leaderboard-site/app/vitest.setup.ts). Does the file exist?
 ❯ loadAndTransform ../node_modules/.pnpm/vite@7.1.3_@types+node@24.3_d231222b04b4f326f7ef8de25d49bc1a/node_modules/vite/dist/node/chunks/dep-Bj7gA1-0.js:26300:33

It looks like it's trying to somehow look for a vitest.setup.ts in the /app directory rather than where it seemingly should be which would be the root of the repo.

Not sure how to fix this configuration issue so the tests reference into the setup file/ config files at the root.
Was this page helpful?