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

Errors when building ui-router (Angular 2.0.0) #3007

Closed
kolkov opened this issue Sep 16, 2016 · 3 comments
Closed

Errors when building ui-router (Angular 2.0.0) #3007

kolkov opened this issue Sep 16, 2016 · 3 comments
Labels
Milestone

Comments

@kolkov
Copy link

kolkov commented Sep 16, 2016

D:\!Projects\TypeScript\ui-router\ui-router>npm test

> ui-router@1.0.0-beta.2 test D:\!Projects\TypeScript\ui-router\ui-router
> npm run test:integrate


> ui-router@1.0.0-beta.2 test:integrate D:\!Projects\TypeScript\ui-router\ui-router
> tsc && npm run test:core && npm run test:ng12 && npm run test:ng13 && npm run test:ng14 && npm run test:ng15

src/common/common.ts(521,40): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(value: any, index: number, array: any[]) => void'.
  Type 'Function' provides no match for the signature '(value: any, index: number, array: any[]): void'
src/common/predicates.ts(7,14): error TS4023: Exported variable 'isDefined' has or is using name 'Predicate' from external module "D:/!Projects/TypeScript/ui-router/ui-router/src/common/common" but cannot be named.
src/common/trace.ts(59,55): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'.
src/state/stateService.ts(299,73): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
src/state/stateService.ts(495,44): error TS2339: Property 'stack' does not exist on type 'string'.
src/state/stateService.ts(496,38): error TS2339: Property 'stack' does not exist on type 'string'.
...
@kolkov
Copy link
Author

kolkov commented Sep 16, 2016

I have built my own version ui-router-ng2 for NG 2.0.0. It's working, but have some errors in tests, because I removed some code for overcome this errors:

src/common/common.ts(521,40): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(value: any, index: number, array: any[]) => void'.
  Type 'Function' provides no match for the signature '(value: any, index: number, array: any[]): void'

I removed type Function from:
function _forEach(obj: (any[]|any), cb, _this: Obj) {

src/common/predicates.ts(7,14): error TS4023: Exported variable 'isDefined' has or is using name 'Predicate' from external module "D:/!Projects/TypeScript/ui-router/ui-router/src/common/common" but cannot be named.
microsoft/TypeScript#5711

I add unused import:
import {Predicate} from "./common";

src/state/stateService.ts(299,74): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
microsoft/TypeScript#2775

I temporarily removed detail from error.detail in https://github.com/angular-ui/ui-router/blob/master/src/state/stateService.ts#L299

and stack from detail.stack
https://github.com/angular-ui/ui-router/blob/master/src/state/stateService.ts#L495
https://github.com/angular-ui/ui-router/blob/master/src/state/stateService.ts#L496

Everything works as it should (tested on quickstart-ng2). I look forward to the new version soon! )))

@christopherthielen
Copy link
Contributor

@christopherthielen christopherthielen added this to the 1.0.0-final milestone Sep 19, 2016
@kolkov
Copy link
Author

kolkov commented Sep 21, 2016

Thanks! Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants