Discussion between me and @chuckjaz:
https://github.com/StephenFluin/aot-repro -> ./node_modules/.bin/ngc -p src/tsconfig.json (after adding "files": ["main"] to tsconfig.json) gives:
Can't resolve all parameters for FirebaseSdkAuthBackend in /Users/hansl/Sources/_/stephenfluin/aot-repro/node_modules/angularfire2/auth/firebase_sdk_auth_backend.d.ts: ([object Object], ?).
This is a very bad error message for an erroneous declaration. The FirebaseSdkAuthBackend declares two parameters to the constructor, on is marked with an @Inject but the other is not. We have a bug in the collector regarding collecting boolean but, even if we didn't, this would be an error because the injector cannot decide how to resolve the boolean parameter which explains the error. The information (because, in part, the collector error) is incorrect.
Looks like FirebaseSdkAuthBackend needs to have both argument non-optional.
Optional is fine but not sufficient. If the type is not a sufficient token
then an @Inject is needed to define what the injector should supply for the
parameter.
On Wed, Dec 21, 2016 at 2:04 PM, Hans notifications@github.com wrote:
Discussion between me and @chuckjaz https://github.com/chuckjaz:
Hans Larsen [10:40]
https://github.com/StephenFluin/aot-repro -> ./node_modules/.bin/ngc -p
src/tsconfig.json (after adding "files": ["main"] to tsconfig.json) gives:Can't resolve all parameters for FirebaseSdkAuthBackend in
/Users/hansl/Sources/_/stephenfluin/aot-repro/node_
modules/angularfire2/auth/firebase_sdk_auth_backend.d.ts: ([objectObject], ?).
Chuck Jazdzewski [13:55]
This is a very bad error message for an erroneous declaration. The
FirebaseSdkAuthBackend declares two parameters to the constructor, on is
marked with an @Inject but the other is not. We have a bug in the
collector regarding collecting boolean but, even if we didn't, this would
be an error because the injector cannot decide how to resolve the boolean
parameter which explains the error. The information (because, in part, thecollector error) is incorrect.
Looks like FirebaseSdkAuthBackend needs to have both argument
non-optional.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/angular/angularfire2/issues/728, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWtLW11psyNwG9gK0sDzBn8sS4UxVVqks5rKaJXgaJpZM4LTbCo
.
@hansl @chuckjaz I think I have an easy fix. The second parameter private _webWorkerMode = false is unneeded as we no longer support Web Workers. I'll remove the parameter and test with Stephen's repo.
@hansl @chuckjaz The fix has been published in the next tag. I've sent a PR to @StephenFluin's AOT repo with the working fix too.
Can you give it a spin and make sure I've gotten everything?
I can confirm that beta.7-pre with your fix makes my project work with AoT and angularfire2. Thanks for the quick solution!
The fix looks good to me.
I was running into issues with AOT on all of the latest angular-cli builds even with angularfire2 beta.7. Just adding "files": ["main"] to my tsconfig.json fixed it!
I had:
"files": [
"typings.d.ts"
]
Working:
"files": [
"typings.d.ts",
"main"
]
thank @davideast your change works for me
it fix build npm install [email protected] --save
@almgwary @davideast
I used your solution but it returns another error
ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /node_modules/angularfire2/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol Injectable in
/node_modules/angularfire2/node_modules/@angular/core/src/di.d.ts, resolving symbol Injectable in /node_modules/angularfire2/node_modules/@angular/core/src/core.d.ts, resolving symbol Injectable in /node_modules/angularfire2/node_modules/@angular/core/index.d.ts, resolving symbol AngularFireAuth in /node_modules/angularfire2/auth/auth.d.ts, resolving symbol AngularFireAuth in /node_modules/angularfire2/auth/auth.d.ts
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts
??
I solve it by making all version having the same value
"@angular/animations": "4.0.2",
"@angular/common": "^4.0.2",
"@angular/compiler": "4.0.2",
"@angular/core": "4.0.2",
"@angular/forms": "4.0.2",
"@angular/http": "4.0.2",
"@angular/platform-browser": "4.0.2",
"@angular/platform-browser-dynamic": "4.0.2",
"@angular/router": "4.0.2",
@mohmedavoelmagd
sorry but this [email protected] make build work here
@almgwary
what's the version of @angular/common you use it?
4.1.3
Most helpful comment
@hansl @chuckjaz The fix has been published in the
nexttag. I've sent a PR to @StephenFluin's AOT repo with the working fix too.Can you give it a spin and make sure I've gotten everything?