Firebase Functions Angular SSR Error Cannot match any routes. URL Segment: ‘index.html’

i deployed the Angular universal app through firebase functions

i am getting a error in the ssr function ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: ‘index.html’ from time to time.
the webApp sometimes works but most of the time it crashes down showing the error

if i run the app locally with "serve:ssr" it works totally fine with no error .

how can i find a fix

Source: Angular Questions