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
{{ message }}
Repository navigation
Nuxt3 with Web Frameworks fails to init or deploy - Cannot create property 'overrides' on string #7375
This is a fresh nuxt install that was created using npx nuxi@latest init
Open the repo.
Run npm i to install deps.
Run firebase init --debug
Choose only Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys.
Use and existing project or create a new one.
[REQUIRED] Expected behavior
Firebase init sets up the firebase project for the repo.
[REQUIRED] Actual behavior
The command fails due to a recent(ish) update in nuxt/kit.
TypeError: Cannot create property 'overrides' on string '/Users/JCGeek/Documents/Projects/firebase-tools-issue/nuxt-app'
at loadNuxtConfig (file:///Users/JCGeek/Documents/Projects/firebase-tools-issue/nuxt-app/node_modules/@nuxt/kit/dist/index.mjs:2581:18)
at async getConfig (/Users/JCGeek/.nvm/versions/node/v20.14.0/lib/node_modules/firebase-tools/lib/frameworks/nuxt/index.js:92:12)
at async discover (/Users/JCGeek/.nvm/versions/node/v20.14.0/lib/node_modules/firebase-tools/lib/frameworks/nuxt/index.js:28:37)
at async discover (/Users/JCGeek/.nvm/versions/node/v20.14.0/lib/node_modules/firebase-tools/lib/frameworks/index.js:47:32)
at async doSetup (/Users/JCGeek/.nvm/versions/node/v20.14.0/lib/node_modules/firebase-tools/lib/init/features/hosting/index.js:54:11)
at async init (/Users/JCGeek/.nvm/versions/node/v20.14.0/lib/node_modules/firebase-tools/lib/init/index.js:39:9)
Research
It looks like firebase-tools is calling loadNuxtConfig(dir)here and passing in dir as a string.
In a recent Nuxt update that was made in PR here loadNuxtConfig now requires an object to be passed in.
Quick Fix
Downgrade nuxt to v3.11.2 - npm i [email protected], and explicitly install @nuxt/kit at 3.11.2 - npm i -D @nuxt/[email protected].
Run firebase init and it should work.
Actual fix
Pass an object through to loadNuxtConfig() - it seems as though passing the dir through has no affect at least in firebase init.
Activity
JamieCurnow commentedon Jun 25, 2024
PR here that fixes the issue.