angularfire: Contributting: Build error

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

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@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

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