Skip to content

Contributting: Build error #875

Closed
Closed

Description

@albanx

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

Activity

  1. davideast commented on Mar 29, 2017

    @davideast
    Collaborator

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

  2. albanx commented on Mar 29, 2017

    @albanx
    Author

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

  3. davideast commented on Mar 29, 2017

    @davideast
    Collaborator

    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.

  4. albanx commented on Mar 29, 2017

    @albanx
    Author
  5. albanx commented on Mar 29, 2017

    @albanx
    Author

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

  6. albanx commented on Mar 29, 2017

    @albanx
    Author

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

  7. albanx commented on Mar 29, 2017

    @albanx
    Author

    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'.
    
  8. davideast commented on Mar 30, 2017

    @davideast
    Collaborator

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

  9. albanx commented on Mar 30, 2017

    @albanx
    Author
  10. changed the title [-]Build error[/-] [+]Contributting: Build error[/+] on Mar 30, 2017
  11. albanx commented on Mar 30, 2017

    @albanx
    Author

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

  12. cartant commented on Mar 30, 2017

    @cartant
    Contributor

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

  13. cartant commented on Mar 30, 2017

    @cartant
    Contributor

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

  14. albanx commented on Mar 30, 2017

    @albanx
    Author

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

  15. albanx commented on Mar 30, 2017

    @albanx
    Author

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

  16. cartant commented on Mar 30, 2017

    @cartant
    Contributor

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

  17. albanx commented on Mar 30, 2017

    @albanx
    Author

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

  18. albanx commented on Mar 30, 2017

    @albanx
    Author

    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
    
  19. cartant commented on Mar 30, 2017

    @cartant
    Contributor

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

  20. cartant commented on Mar 30, 2017

    @cartant
    Contributor

    @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
    
  21. added a commit that references this issue on Mar 30, 2017
    3e134a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions