Description
Version info
Angular:
"@angular/animations": "~9.0.0", "@angular/cdk": "^9.0.0", "@angular/common": "~9.0.0", "@angular/compiler": "~9.0.0", "@angular/core": "~9.0.0",
Firebase:
"_from": "firebase@>= 5.5.7 <8",
"_id": "firebase@7.8.1",
AngularFire:
"@angular/fire": "^6.0.0-rc.1",
How to reproduce these conditions
project link will be delete after resolve this issue
Steps to set up and reproduce
after adding Angularfire, it's work normally. But when I start with Universal build, it have problem, clone project and start:
npm run dev:ssr
Debug output
E:\coronavirus-tracking\dist\coronavirus-tracking\ser
ver\main.js:197014
throw new Error("package.json does not exist at " + package_json_path);
^
Error: package.json does not exist at E:\coronavirus-tracking\dist\coronavirus-tracking\package.json
at Object../node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js.exports.find (E:\coronavirus-tracking\dist\coronavirus-tracking\server\main.js:197014:15)
after comment firebase library:
look like the error disappear but sure. angularfire cannot run without firebase/firestore
Expected behavior
not have error when building with universal
Actual behavior
build not succesful
already read about:
#2284
angular issue #34544
#2280
i'm starting desperated after 5 hours
Updated
universal #1207 suggest adding this but it not work:
// angular.json > architect.server.options
"externalDependencies": [
"grpc",
"@grpc/proto-loader"
]
Updated 1
#2284 suggest adding "@angular/fire/firestore"
seem work but got other error:
// angular.json > architect.server.options
"externalDependencies": [
"grpc",
"@grpc/proto-loader",
@angular/fire/firestore"
]
Cannot read property 'id' of undefined
update 3:
add "bundleDependencies": true
to angular.json
then run npm run build:ssr && npm run serve:ssr
having this issues. guest that relate to this #2280
ERROR Error: inject() must be called from an injection context