N
Nuxt6mo ago
tim

Nuxt 3.12.1 Update: Prerender Error with app.use Function

Hello everyone! I've recently encountered an issue after updating to Nuxt version 3.12.1. My deployment to Cloudflare Pages fails during the prerendering process with a SyntaxError: Need to install with \app.use functionerror. This problem did not occur in the previous version (3.11.2), and it only affects the Pull Request Preview Deployment. Here's mynpx nuxi info for reference: - Operating System: Windows_NT - Node Version: v20.8.1 - Nuxt Version: 3.12.1 - CLI Version: 3.12.0 - Nitro Version: 2.9.6 - Package Manager: [email protected] - User Config: preset, experimental, devtools, modules, serverMiddleware, supabase, i18n, cloudflareAnalytics, turnstile, css, postcss, app, runtimeConfig, routeRules, image, security, content, typescript - Runtime Modules: @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxthq/[email protected], [email protected], [email protected], [email protected], [email protected] Has anyone else experienced this issue, or does anyone have insights on what might be causing this and how to resolve it? Any help would be greatly appreciated! Locally when entering the dev mode, the logs have shown different errors on different starts. At first it was the i18n module which seems to create the problem but now its Supabase and due to my usage of Cloudflare Pages and my tests I am really sure that it is because of the upgrade. When I downgrade back everything seems to work fine. Has something changed for configuring the Nuxt Configuration file (nuxt.config.ts)?
5 Replies
tim
timOP6mo ago
This was the initial (500) error:
message-compiler.mjs:94 Uncaught (in promise) SyntaxError: Need to install with `app.use` function (at message-compiler.mjs:94:19)
at createCompileError (message-compiler.mjs:94:19)
at createI18nError (vue-i18n.mjs:103:12)
at useI18n (vue-i18n.mjs:2325:15)
at setup (app.vue:13:40)
at callWithErrorHandling (runtime-core.esm-bundler.js:195:19)
at setupStatefulComponent (runtime-core.esm-bundler.js:7630:25)
at setupComponent (runtime-core.esm-bundler.js:7591:36)
at mountComponent (runtime-core.esm-bundler.js:5917:7)
at processComponent (runtime-core.esm-bundler.js:5883:9)
at patch (runtime-core.esm-bundler.js:5351:11)
message-compiler.mjs:94 Uncaught (in promise) SyntaxError: Need to install with `app.use` function (at message-compiler.mjs:94:19)
at createCompileError (message-compiler.mjs:94:19)
at createI18nError (vue-i18n.mjs:103:12)
at useI18n (vue-i18n.mjs:2325:15)
at setup (app.vue:13:40)
at callWithErrorHandling (runtime-core.esm-bundler.js:195:19)
at setupStatefulComponent (runtime-core.esm-bundler.js:7630:25)
at setupComponent (runtime-core.esm-bundler.js:7591:36)
at mountComponent (runtime-core.esm-bundler.js:5917:7)
at processComponent (runtime-core.esm-bundler.js:5883:9)
at patch (runtime-core.esm-bundler.js:5351:11)
This is the latest (500) error:
[nuxt] error caught during app initialization TypeError: Cannot destructure property 'url' of 'config' as it is undefined.
at setup (supabase.client.mjs:11:13)
at client.mjs:35:36
at executeAsync (index.mjs:111:19)
at setup (client.mjs:35:36)
at nuxt.js:137:60
at fn (nuxt.js:214:44)
at Object.runWithContext (runtime-core.esm-bundler.js:3980:18)
at callWithNuxt (nuxt.js:220:24)
at nuxt.js:37:41
at EffectScope.run (reactivity.esm-bundler.js:43:16)
[nuxt] error caught during app initialization TypeError: Cannot destructure property 'url' of 'config' as it is undefined.
at setup (supabase.client.mjs:11:13)
at client.mjs:35:36
at executeAsync (index.mjs:111:19)
at setup (client.mjs:35:36)
at nuxt.js:137:60
at fn (nuxt.js:214:44)
at Object.runWithContext (runtime-core.esm-bundler.js:3980:18)
at callWithNuxt (nuxt.js:220:24)
at nuxt.js:37:41
at EffectScope.run (reactivity.esm-bundler.js:43:16)
Smef
Smef6mo ago
I've seen this brought up a bunch with 3.12.1. I believe this is something being looked into There's something going on breaking runtime for modules
tim
timOP6mo ago
Oh luckily, I already feared that the configuration should have been more fine-grained and that I had made mistakes that would only stop the startup with the new version, but that reassures me, then it goes back to the old version for now. Thank you very much! Do you know if there is any issue open for that already?
Smef
Smef6mo ago
I'm not sure. I saw Daniel Roe say he was checking into the issue from some comments in another channel It looks like Daniel identified and has resolved the issue
Smef
Smef6mo ago
GitHub
fix(nuxt): use portal to sync nitro/nuxt runtimeConfig + routeRules...
🔗 Linked issue resolves #27589 📚 Description As a result of the refactor to runtimeConfig in #27117, it was possible to 'detach' these values if overwriting nuxt.options.runtimeConfig. This...
Want results from more Discord servers?
Add your server