By following the instruction of the contribute page https://github.com/angular/angularfire2/blob/master/CONTRIBUTING.md#setup, I tried to build locally:
$ git clone (form my fork)
$ npm install
$ npm run build
The last command failed with the following:
[email protected] build /Users/alban/projects/angularfire2
rm -rf dist && tsc && rollup -c rollup.test.config.js
src/auth/auth.spec.ts(451,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
Property 'jasmineMatches' is missing in type '{ provider: string; }'.
src/auth/auth.spec.ts(505,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
src/database/firebase_list_factory.spec.ts(742,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
Property 'jasmineMatches' is missing in type 'string[]'.
src/database/firebase_list_factory.spec.ts(743,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(782,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(783,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(822,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(823,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/query_observable.spec.ts(10,28): error TS2345: Argument of type 'Query' is not assignable to parameter of type 'Expected<ScalarQuery>'.
Type 'Query' is not assignable to type 'ObjectContaining<ScalarQuery>'.
Property 'jasmineMatches' is missing in type 'Query'.
Node info:
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
Typescript version @2.2.1 (from angular cli):
npm list -g | grep type
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
OS:
MacOS Sierra 10.12.3
@albanx Please follow the issue template as it would be good to know your TypeScript version.
@davideast I just did an installation from scracht installing the default stuff included in the package.json. I updated with some more info the issue.
Your TypeScript version is local to your machine. Do a tsc -v on your machine. Also, what OS are you on? These are all requirements for us to troubleshoot bugs.
I do not understand, what do you mean local? the global node package or the
local node package?
@davidarich I do not have tsc compiler installed
On Wed, Mar 29, 2017 at 7:47 PM, David East notifications@github.com
wrote:
Your TypeScript version is local to your machine.
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/angular/angularfire2/issues/875#issuecomment-290168244,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABFAqJnpL2bZWY8loSuw1Ah0PC2JrXGiks5rqpkogaJpZM4MsvSH
.
Really strange no where there is an instruction to install typescript with angular 2
@davideast I did a fresh install, removed, cli, installed everything from scratch including tsc and angular, same result. I will try on a fresh linux distro now.
Run on ubuntu same results:
alban@alban-Latitude-E6540:~/projects/angularfire2$ npm run build
> [email protected] build /home/alban/projects/angularfire2
> rm -rf dist && tsc && rollup -c rollup.test.config.js
src/auth/auth.spec.ts(451,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
Property 'jasmineMatches' is missing in type '{ provider: string; }'.
src/auth/auth.spec.ts(505,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
src/database/firebase_list_factory.spec.ts(742,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
Property 'jasmineMatches' is missing in type 'string[]'.
src/database/firebase_list_factory.spec.ts(743,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(782,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(783,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(822,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(823,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/query_observable.spec.ts(10,28): error TS2345: Argument of type 'Query' is not assignable to parameter of type 'Expected<ScalarQuery>'.
Type 'Query' is not assignable to type 'ObjectContaining<ScalarQuery>'.
Property 'jasmineMatches' is missing in type 'Query'.
npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `rm -rf dist && tsc && rollup -c rollup.test.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script 'rm -rf dist && tsc && rollup -c rollup.test.config.js'.
@albanx What OS are you running? Please use the issue template.
David you have all details above. I run it on MacOs Sierra, then on
Ubuntu... I tried fresh install of every package. The result is the same
error.
On 30 Mar 2017 02:06, "David East" notifications@github.com wrote:
@albanx https://github.com/albanx What OS are you running? Please use
the issue template.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/angular/angularfire2/issues/875#issuecomment-290271781,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABFAqHLmgvhjuFpCNpgXGRkG1awD_AZ0ks5rqwAegaJpZM4MsvSH
.
@davideast Please look the edit. Just to clarify this is not a bug regarding the use of the library, but a bug regarding the development of it (I am trying to contribute to it)
@albanx Please don't make substantial edits to GitHub comments. Unlike Stack Overflow, for example, there is no edit history, so substantial edits can make conversations much more difficult to follow.
@albanx From a console located in the project's root, run the commands separately, to verify which is failing:
tsc./node_modules/.bin/rollup -c rollup.test.config.jsAlso, your branch is not up to date with the latest master. You should address that, too.
@cartant of course I just added more information on the issue, I did not change the scope of it. The problem is still the same. Do you have any clue why I have this issue? Can someone please try the exact same thing and let me know if it works?
@cartant tsc is failing:
Alban-MacBook-Pro:angularfire2 alban$ tsc
src/auth/auth.spec.ts(451,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
Property 'jasmineMatches' is missing in type '{ provider: string; }'.
src/auth/auth.spec.ts(505,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
src/database/firebase_list_factory.spec.ts(742,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
Property 'jasmineMatches' is missing in type 'string[]'.
src/database/firebase_list_factory.spec.ts(743,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(782,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(783,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(822,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(823,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/query_observable.spec.ts(10,28): error TS2345: Argument of type 'Query' is not assignable to parameter of type 'Expected<ScalarQuery>'.
Type 'Query' is not assignable to type 'ObjectContaining<ScalarQuery>'.
Property 'jasmineMatches' is missing in type 'Query'.
I forked the branch 1 day ago, how outdate can it be?
@albanx How out-of-date doesn't matter. If you have a problem, you have to remove as many differences and variables as possible. What happens if you run ./node_modules/.bin/tsc?
./node_modules/.bin/tsc:
Alban-MacBook-Pro:angularfire2 alban$ ./node_modules/.bin/tsc
src/auth/auth.spec.ts(451,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
Property 'jasmineMatches' is missing in type '{ provider: string; }'.
src/auth/auth.spec.ts(505,38): error TS2345: Argument of type '{ provider: string; }' is not assignable to parameter of type 'Expected<UserInfo>'.
Type '{ provider: string; }' is not assignable to type 'ObjectContaining<UserInfo>'.
src/database/firebase_list_factory.spec.ts(742,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
Property 'jasmineMatches' is missing in type 'string[]'.
src/database/firebase_list_factory.spec.ts(743,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(782,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(783,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(822,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(823,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/query_observable.spec.ts(10,28): error TS2345: Argument of type 'Query' is not assignable to parameter of type 'Expected<ScalarQuery>'.
Type 'Query' is not assignable to type 'ObjectContaining<ScalarQuery>'.
Property 'jasmineMatches' is missing in type 'Query'.
@davideast "How out-of-date doesn't matter" forked 24 hours ago yesterday on a mac pc, then 10 hours ago on a ubuntu pc, do you want me to do a fresh clone now? (but it will be again 1 minute out of date)?
Just cloned again right now, here is the errors (slighty changed due to the fix done some hours ago from David probably):
MacOS Sierra, Tsc Version 2.2.2
Alban-MacBook-Pro:angularfire2 alban$ npm run build
> [email protected] build /Users/alban/projects/angularfire2
> rm -rf dist && tsc && rollup -c rollup.test.config.js
src/database/firebase_list_factory.spec.ts(775,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
Property 'jasmineMatches' is missing in type 'string[]'.
src/database/firebase_list_factory.spec.ts(776,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(815,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(816,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(855,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/firebase_list_factory.spec.ts(856,52): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Expected<Observable<any>>'.
Type 'string[]' is not assignable to type 'ObjectContaining<Observable<any>>'.
src/database/query_observable.spec.ts(10,28): error TS2345: Argument of type 'Query' is not assignable to parameter of type 'Expected<ScalarQuery>'.
Type 'Query' is not assignable to type 'ObjectContaining<ScalarQuery>'.
Property 'jasmineMatches' is missing in type 'Query'.
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `rm -rf dist && tsc && rollup -c rollup.test.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script 'rm -rf dist && tsc && rollup -c rollup.test.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angularfire2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! rm -rf dist && tsc && rollup -c rollup.test.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angularfire2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angularfire2
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/alban/projects/angularfire2/npm-debug.log
Alban-MacBook-Pro:angularfire2 alban$ time
real 0m0.000s
user 0m0.000s
sys 0m0.000s
Alban-MacBook-Pro:angularfire2 alban$ date
Thu 30 Mar 2017 11:43:28 IST
@albanx @davideast Well, I've reproduced the problem, but I don't yet know the cause. I'll have a look into it, but probably not till tomorrow.
@albanx @davideast The problem is down the @types/jasmine version.
In 2.5.46 - the latest version is 2.5.47 - the declarations where significantly changed and many uses of any were replaced with more specific types. In particular, an Expected<T> type was added and it's that that's causing the TypeScript errors.
I'll look further into the tests to see what needs to be fixed, but in the meantime, the workaround is to install a pre-2.5.46 version:
npm uninstall @types/jasmine; npm install @types/[email protected]
Most helpful comment
@albanx @davideast The problem is down the
@types/jasmineversion.In 2.5.46 - the latest version is 2.5.47 - the declarations where significantly changed and many uses of
anywere replaced with more specific types. In particular, anExpected<T>type was added and it's that that's causing the TypeScript errors.I'll look further into the tests to see what needs to be fixed, but in the meantime, the workaround is to install a pre-2.5.46 version: