Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributting: Build error #875

Closed
albanx opened this issue Mar 29, 2017 · 19 comments
Closed

Contributting: Build error #875

albanx opened this issue Mar 29, 2017 · 19 comments

Comments

@albanx
Copy link

albanx commented Mar 29, 2017

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:

angularfire2@2.0.0-beta.8 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
│ │ │ │ │ │   ├── domelementtype@1.1.3
│ │ │ │ │ ├── domelementtype@1.3.0
│ │ │ ├─┬ babel-types@6.23.0
│ │   ├── is-typedarray@1.0.0
│ │   ├─┬ mime-types@2.1.15
│ │ │ │   └── path-type@1.1.0
│ ├── typescript@2.2.1
│ │ │ │   │ ├── is-typedarray@1.0.0
│ │ │ │   │ ├─┬ mime-types@2.1.14
│ │ │ ├── content-type@1.0.2
│ │ │ ├── setprototypeof@1.0.3
│ │ │ ├─┬ type-is@1.6.14
│ │ │ │ └── media-typer@0.3.0
│ │ │   └── setprototypeof@1.0.2
│ │   │   └── path-type@1.1.0
│ │ │   │   └── path-type@1.1.0
│ │ │ └── typedarray@0.0.6
│ │ ├── is-typedarray@1.0.0
│ │ ├─┬ mime-types@2.1.12
  │ │ │ └── typedarray@0.0.6
  │ │ ├── is-typedarray@1.0.0
  │ │ ├─┬ mime-types@2.1.12

OS:

MacOS Sierra 10.12.3

@davideast
Copy link
Member

@albanx Please follow the issue template as it would be good to know your TypeScript version.

@albanx
Copy link
Author

albanx commented Mar 29, 2017

@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.

@davideast
Copy link
Member

davideast commented Mar 29, 2017

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.

@albanx
Copy link
Author

albanx commented Mar 29, 2017 via email

@albanx
Copy link
Author

albanx commented Mar 29, 2017

Really strange no where there is an instruction to install typescript with angular 2

@albanx
Copy link
Author

albanx commented Mar 29, 2017

@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.

@albanx
Copy link
Author

albanx commented Mar 29, 2017

Run on ubuntu same results:

alban@alban-Latitude-E6540:~/projects/angularfire2$ npm run build

> angularfire2@2.0.0-beta.8 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! angularfire2@2.0.0-beta.8 build: `rm -rf dist && tsc && rollup -c rollup.test.config.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the angularfire2@2.0.0-beta.8 build script 'rm -rf dist && tsc && rollup -c rollup.test.config.js'.

@davideast
Copy link
Member

@albanx What OS are you running? Please use the issue template.

@albanx
Copy link
Author

albanx commented Mar 30, 2017 via email

@albanx albanx changed the title Build error Contributting: Build error Mar 30, 2017
@albanx
Copy link
Author

albanx commented Mar 30, 2017

@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)

@cartant
Copy link
Contributor

cartant commented Mar 30, 2017

@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.

@cartant
Copy link
Contributor

cartant commented Mar 30, 2017

@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.js

Also, your branch is not up to date with the latest master. You should address that, too.

@albanx
Copy link
Author

albanx commented Mar 30, 2017

@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?

@albanx
Copy link
Author

albanx commented Mar 30, 2017

@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?

@cartant
Copy link
Contributor

cartant commented Mar 30, 2017

@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?

@albanx
Copy link
Author

albanx commented Mar 30, 2017

./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)?

@albanx
Copy link
Author

albanx commented Mar 30, 2017

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

> angularfire2@4.0.0-rc0 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! angularfire2@4.0.0-rc0 build: `rm -rf dist && tsc && rollup -c rollup.test.config.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the angularfire2@4.0.0-rc0 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

@cartant
Copy link
Contributor

cartant commented Mar 30, 2017

@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.

@cartant
Copy link
Contributor

cartant commented Mar 30, 2017

@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/jasmine@2.5.45

cartant added a commit to cartant/angularfire that referenced this issue Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants