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
Deploy the application with firebase deploy --only hosting
Open the generated web.app link and navigate a route other than /
It displays an error, usually "Service Unavailable". If you open the logs of your ssr function, you'll see that the error that caused this response is:
TypeError: require(...).app is not a function
at Object.<anonymous> (/workspace/bootstrap.js:1:51)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Which originates from .firebase/example-app/functions/bootstrap.js that was generated by firebase-tools:
Render function crashes due to the above mentioned exception.
Additional comment
The current firebase-tools library clearly lacks support for Angular 17 and it's renewed way of building the application bundle. Starting from the required modification in angular.json in order to force the firebase CLI to upload the server bundle, all the way to the generated function code is not supported by the cloud running environment or the missing rewrite rule that you need to manually add to firebase.json even tho it's aware that the application has SSR capability.
The text was updated successfully, but these errors were encountered:
misomarcell
changed the title
Angular 17 SSR on firebase functions: TypeError: require(...).app is not a function
Angular 17 SSR on firebase functions: TypeError: require(...).app is not a functionNov 14, 2023
[REQUIRED] Environment info
firebase-tools: 12.8.1
Platform: Windows 11
[REQUIRED] Test case
https://github.com/misomarcell/fire-chat/tree/cb090fbc5b6dae4da079cd0b2b3d0ea4b2108ba1
[REQUIRED] Steps to reproduce
firebase experiments:enable webframeworks
firebase init
app.routes.ts
angular.json
so it builds your browser and server bundles separately:firebase deploy --only hosting
/
Which originates from
.firebase/example-app/functions/bootstrap.js
that was generated by firebase-tools:[REQUIRED] Expected behavior
Render function works without an exception.
[REQUIRED] Actual behavior
Render function crashes due to the above mentioned exception.
Additional comment
The current firebase-tools library clearly lacks support for Angular 17 and it's renewed way of building the application bundle. Starting from the required modification in angular.json in order to force the firebase CLI to upload the server bundle, all the way to the generated function code is not supported by the cloud running environment or the missing rewrite rule that you need to manually add to firebase.json even tho it's aware that the application has SSR capability.
The text was updated successfully, but these errors were encountered: