-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Título del Bug: Framework Detection Fails for Next.js in Firebase Studio Environment Despite Explicit Configuration
Cuerpo del Reporte:
[REQUIRED] Environment info
firebase-tools: 13.10.2 (versión del package.json)
Platform: Firebase Studio Environment (via idx.dev)
[REQUIRED] Test case
A standard Next.js 14 application with PWA features (@ducanh2912/next-pwa) and Firebase integration. The project builds successfully locally using npm run build.
firebase.json configuration:
{
"hosting": {
"source": ".",
"ignore": [
"firebase.json",
"/.*",
"/node_modules/**"
],
"frameworksBackend": {
"region": "us-central1",
"framework": "nextjs"
}
},
"firestore": {
"rules": "suggested-firestore.rules"
}
}
next.config.mjs configuration:
/** @type {import('next').NextConfig} */
const withPWA = require('@ducanh2912/next-pwa').default({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
skipWaiting: true,
});
const nextConfig = {
reactStrictMode: true,
};
module.exports = withPWA(nextConfig);
[REQUIRED] Steps to reproduce
Create or use a Next.js project within the Firebase Studio IDE.
Configure firebase.json to explicitly use the Next.js framework as shown above.
Ensure the project compiles successfully via npm run build.
Attempt to deploy using the command firebase deploy --only hosting from the integrated terminal.
[REQUIRED] Expected behavior
The Firebase CLI should respect the frameworksBackend: { framework: "nextjs" } configuration, build the Cloud Function for SSR, and deploy the application to Firebase Hosting without trying to auto-detect the framework.
[REQUIRED] Actual behavior
The deployment process fails consistently with the error: Error: Unable to detect the web framework in use, even when the framework is explicitly defined in firebase.json. The --debug logs show that authentication and permissions are successful, but the framework detection logic fails.