N
Nuxt6mo ago
GerryWilko

Upgrade to nuxt 3.12.2 @nuxt/test-utils issue

I am getting the following error since upgrading to 3.12.2.
[nuxt] [request error] [unhandled] [500] Cannot find module '/Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/node_modules/vue/server-renderer/index.mjs' imported from /Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/chunks/routes/renderer.mjs
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36)
[nuxt] [request error] [unhandled] [500] Cannot find module '/Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/node_modules/vue/server-renderer/index.mjs' imported from /Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/chunks/routes/renderer.mjs
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36)
[nuxt] [request error] [unhandled] [500] Cannot find module '/Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/node_modules/vue/server-renderer/index.mjs' imported from /Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/chunks/routes/renderer.mjs
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36)
[nuxt] [request error] [unhandled] [500] Cannot find module '/Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/node_modules/vue/server-renderer/index.mjs' imported from /Users/gerard/Developer/customer-portal/apps/customer-portal/.nuxt/test/prrqtu/output/server/chunks/routes/renderer.mjs
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36)
This occurs after build during a playwright test. Following the instructions on e2e testing on the docs. This worked before upping the relevant deps to 3.12.2.
No description
3 Replies
GerryWilko
GerryWilkoOP6mo ago
Checking the file it references it does seem to be that the renderer is not bundled. I do have a prerenderer error during build as my application has dynamic routes and no / for some tenants. However telling the prerenderer not to error on fail and ignoring / clears this error but does not address this issue. Is this related to hoisting of dependencies with pnpm? I have shamefully-hoist set both in my workspace root and on the nuxt project itself and still doesnt seem to be bundling this dependency
manniL
manniL6mo ago
this seems to be a hoisting topic, yes
GerryWilko
GerryWilkoOP6mo ago
It seems to only affect builds and output when running the build as part of the setupHooks in e2e testing. Does anybody know why this might be? So I have resolved this simply by pinning the vue version of 3.4.31 in the nuxt app package.json. Not sure which patch version sorts this but if anyone gets stuck on the same thing hopefully this helps.
Want results from more Discord servers?
Add your server