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
If we have a special implementation in the prerender environment, we may want to test it with its built from time to time.
case: nuxt-modules/i18n#1733
In @nuxt/test-utils setup, we can override the nuxtConfig option with _generate: true, which is equivalent to nuxi generate.
However, the server in @nuxt/test-utils is not yet ready to run a server for the prerender environment, so the test will stop with the following log output:
Error: Cannot find module '/path/to/nuxt/i18n/specs/fixtures/basic/.nuxt/ubpgju/output/server/index.mjs'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
Additional information
Would you be willing to help implement this feature?
Hi dear @kazupon. _generate is an internal flag an indeed unsupported for test-utils at the moment. What you can do, is to alternatively enable experimental.payloadExtraction and also enable nitro.prerender.crawlLinks: true. This generates server that serves static files as well. You can also use X-Powered-By header to assert if response is static or rendered on demand.
I’ve felt that _generate is for internal.
About experimental.payloadExtraction and nitro.prerender.crawlLinks: true, those are good and helpful for me. :)
Thanks!
Describe the feature
If we have a special implementation in the prerender environment, we may want to test it with its built from time to time.
case: nuxt-modules/i18n#1733
In
@nuxt/test-utils
setup, we can override thenuxtConfig
option with_generate: true
, which is equivalent tonuxi generate
.However, the server in
@nuxt/test-utils
is not yet ready to run a server for the prerender environment, so the test will stop with the following log output:Error: Cannot find module '/path/to/nuxt/i18n/specs/fixtures/basic/.nuxt/ubpgju/output/server/index.mjs' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47 {
Additional information
Final checks
The text was updated successfully, but these errors were encountered: