firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.02k stars 938 forks source link

Unable to detect the web framework in use when using angular app within nx monorepo #6049

Open kedevked opened 1 year ago

kedevked commented 1 year ago

[REQUIRED] Environment info

firebase-tools: 12.4.1

Platform: Windows wsl

[REQUIRED] Steps to reproduce

✔ Where would you like to create your workspace? · org ✔ Which stack do you want to use? · angular ✔ Standalone project or integrated monorepo? · integrated ✔ Application name · org ✔ Default stylesheet format · scss ✔ Would you like to use Standalone Components in your application? · Yes ✔ Would you like to add routing? · Yes ✔ Enable distributed caching to make your CI faster · No

npm install @angular/fire

npx nx g @angular/fire:ng-add

firebase deploy

[REQUIRED] Expected behavior

expect the app to be deployed to firebase

[REQUIRED] Actual behavior

throws error

Unable to detect the web framework in use

google-oss-bot commented 1 year ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

robinstaudinger commented 1 year ago

I'm facing the same issue with NextJS and NX

borisyordanov commented 1 year ago

Monorepos are not officially supported https://github.com/firebase/firebase-tools/issues/653 You might be able to create a hack to get it working, but from my experience you're better of looking elsewhere for your monorepo hosting needs

kedevked commented 1 year ago

Given the popularity of nx within the JavaScript ecosystem tooling, I would be surprised if nx is officially not supported

ibrahimAboelsuod commented 1 year ago

I also have the same problem. Maybe it can be fixed with an option to manually choose nextjs?

ezzabuzaid commented 1 year ago

This line - frameworks/angular/index.ts

It requires angular.json, if we can have that as parameter it might work!

Niklas3011 commented 1 year ago

Is there an alternative to firebase which is supported for an Angular App within a NX Monorepo?

alexdabast commented 11 months ago

This line - frameworks/angular/index.ts

It requires angular.json, if we can have that as parameter it might work!

Yeah I was looking at the source and it also required a package.json file ... which NX do not create in their app folder. So my hack was to copy project.json to angular.json and to put a "dummy" package.json file but you also need to perform npm i on your source folder otherwise you will face the next "check" that firebase tools is doing and it is to check if the command ng is available in the soruce folder ...

https://github.com/firebase/firebase-tools/blob/cf9379f89b20e8ea0cc36a485488399442155e4c/src/frameworks/utils.ts#L248

SvenBudak commented 10 months ago

Since Angular 17 and the SSR update, we have been using SSR and Firebase hosting. However, this is currently not possible as all our apps are in an NX monorepo. We are currently separating all apps into their own repositories, but this makes maintenance much more difficult due to common libraries. We would really appreciate a solution that is directly integrated into the Firebase CLI.

Crocsx commented 10 months ago

Yeah, same here, it took me to long to find this thread, If this is not planned to be supported, I would at least expect some clear info in the doc stating that mono repo are not supported.

AlmaniaM commented 1 month ago

We're using Angular 18 SSR with NX v19 and @alexdabast's solution is working but not sustainable. The project is recognized as a Vite project and it does not work. Are there any plans to support NX monorepos with Angular or any other project?

alexdabast commented 1 month ago

@AlmaniaM we are now using firebase "App Hosting" feature and it supports everything We also move to pnpm who is also supported by app hosting

AlmaniaM commented 1 month ago

@AlmaniaM we are now using firebase "App Hosting" feature and it supports everything We also move to pnpm who is also supported by app hosting

Interesting. I've been trying to get App Hosting to work but It keeps failing to deploy on the last step with no helpful logging either.