question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript compilation errors

See original GitHub issue

I just tried to integrate it and I got this. The other tickets related to Typescript are issue with the types but this one is different.

Dependencies

"dependencies": {
    "@angular/common": "4.1.0",
    "@angular/compiler": "4.1.0",
    "@angular/compiler-cli": "4.1.0",
    "@angular/core": "4.1.0",
    "@angular/forms": "4.1.0",
    "@angular/http": "4.1.0",
    "@angular/platform-browser": "4.1.0",
    "@angular/platform-browser-dynamic": "4.1.0",
    "@ionic-native/core": "3.7.0",
    "@ionic-native/splash-screen": "3.7.0",
    "@ionic-native/status-bar": "3.7.0",
    "@ionic/storage": "2.0.1",
    "apollo-angular": "^0.13.0",
    "apollo-client": "^1.9.1",
    "graphql-tag": "^2.4.2",
    "ionic-angular": "3.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.10"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-ionic-angular": "1.1.2",
    "ionic": "3.6.0",
    "typescript": "2.2.1"
  },

Error

ionic-app-scripts serve

[01:17:49]  ionic-app-scripts 1.3.7
[01:17:49]  watch started ...
[01:17:49]  build dev started ...
[01:17:49]  clean started ...
[01:17:49]  clean finished in 2 ms
[01:17:49]  copy started ...
[01:17:49]  transpile started ...
[01:17:51]  typescript: node_modules/apollo-client/core/types.d.ts, line: 17
            ',' expected.

      L16:  };
      L17:  export declare type ApolloExecutionResult<T = {
      L18:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/core/types.d.ts, line: 17
            '>' expected.

      L16:  };
      L17:  export declare type ApolloExecutionResult<T = {
      L18:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/core/types.d.ts, line: 19
            ';' expected.

      L18:      [key: string]: any;
      L19:  }> = {
      L20:      data?: T;

[01:17:51]  typescript: node_modules/apollo-client/core/types.d.ts, line: 19
            Expression expected.

      L18:      [key: string]: any;
      L19:  }> = {
      L20:      data?: T;

[01:17:51]  typescript: node_modules/apollo-client/core/types.d.ts, line: 20
            Expression expected.

      L19:  }> = {
      L20:      data?: T;
      L21:  };

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 47
            ',' expected.

      L47:  export interface MutationOptions<T = {
      L48:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 47
            '>' expected.

      L47:  export interface MutationOptions<T = {
      L48:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 49
            Expression expected.

      L48:      [key: string]: any;
      L49:  }> {
      L50:      mutation: DocumentNode;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 50
            ',' expected.

      L49:  }> {
      L50:      mutation: DocumentNode;
      L51:      variables?: Object;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 51
            ',' expected.

      L50:  mutation: DocumentNode;
      L51:  variables?: Object;
      L52:  optimisticResponse?: Object | Function;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 52
            ',' expected.

      L51:  variables?: Object;
      L52:  optimisticResponse?: Object | Function;
      L53:  updateQueries?: MutationQueryReducersMap<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 53
            '(' expected.

      L52:  optimisticResponse?: Object | Function;
      L53:  updateQueries?: MutationQueryReducersMap<T>;
      L54:  refetchQueries?: string[] | PureQueryOptions[];

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 54
            ',' expected.

      L53:  updateQueries?: MutationQueryReducersMap<T>;
      L54:  refetchQueries?: string[] | PureQueryOptions[];
      L55:  update?: MutationUpdaterFn<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 55
            '(' expected.

      L54:      refetchQueries?: string[] | PureQueryOptions[];
      L55:      update?: MutationUpdaterFn<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 57
            ',' expected.

      L57:  export declare type MutationUpdaterFn<T = {
      L58:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 57
            '>' expected.

      L57:  export declare type MutationUpdaterFn<T = {
      L58:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 59
            ';' expected.

      L58:      [key: string]: any;
      L59:  }> = (proxy: DataProxy, mutationResult: ApolloExecutionResult<T>) => void;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 59
            Expression expected.

      L58:      [key: string]: any;
      L59:  }> = (proxy: DataProxy, mutationResult: ApolloExecutionResult<T>) => void;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 59
            Expression expected.

      L58:      [key: string]: any;
      L59:  }> = (proxy: DataProxy, mutationResult: ApolloExecutionResult<T>) => void;

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 8
            ',' expected.

       L7:  }) => Record<string, any>;
       L8:  export declare type MutationQueryReducersMap<T = {
       L9:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 8
            '>' expected.

       L7:  }) => Record<string, any>;
       L8:  export declare type MutationQueryReducersMap<T = {
       L9:      [key: string]: any;

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 10
            ';' expected.

       L9:      [key: string]: any;
      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 10
            Expression expected.

       L9:      [key: string]: any;
      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 11
            ',' expected.

      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;
      L12:  };

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 11
            ';' expected.

      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;
      L12:  };

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 11
            '(' expected.

      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;
      L12:  };

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            ',' expected.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            ',' expected.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            '(' expected.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            Expression expected.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 15
            ',' expected.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;
      L16:      context?: C;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 16
            ',' expected.

      L15:      extensions?: E;
      L16:      context?: C;
      L17:  };

[01:17:51]  typescript: node_modules/zen-observable-ts/lib/zenObservable.d.ts, line: 30
            ',' expected.

      L29:  filter(fn: (value: T) => boolean): Observable<T>;
      L30:  reduce<R = T>(fn: (previousValue: R | T, currentValue: T) => R | T, initialValue?: R | T): Observable<R | T>
      L31:  flatMap<R>(fn: (value: T) => ZenObservable.ObservableLike<R>): Observable<R>;

[01:17:51]  typescript: node_modules/@types/graphql/subscription/subscribe.d.ts, line: 17
            Cannot find name 'AsyncIterator'.

      L16:      subscribeFieldResolver?: GraphQLFieldResolver<any, any>
      L17:  ): AsyncIterator<ExecutionResult>;

[01:17:51]  typescript: node_modules/@types/graphql/subscription/subscribe.d.ts, line: 29
            Cannot find name 'AsyncIterable'.

      L28:      fieldResolver?: GraphQLFieldResolver<any, any>
      L29:  ): AsyncIterable<any>;

[01:17:51]  typescript: node_modules/apollo-angular/build/src/Apollo.d.ts, line: 14
            Generic type 'MutationOptions<T>' requires 1 type argument(s).

      L13:  query<T>(options: WatchQueryOptions): Observable<ApolloQueryResult<T>>;
      L14:  mutate<T>(options: MutationOptions): Observable<ApolloQueryResult<T>>;
      L15:  subscribe(options: SubscriptionOptions): Observable<any>;

[01:17:51]  typescript: node_modules/apollo-client/core/types.d.ts, line: 20
            Cannot find name 'data'.

      L19:  }> = {
      L20:      data?: T;
      L21:  };

[01:17:51]  typescript: node_modules/apollo-client/core/types.d.ts, line: 20
            Cannot find name 'T'.

      L19:  }> = {
      L20:      data?: T;
      L21:  };

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 50
            'DocumentNode' only refers to a type, but is being used as a value here.

      L49:  }> {
      L50:      mutation: DocumentNode;
      L51:      variables?: Object;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 52
            The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.

      L51:  variables?: Object;
      L52:  optimisticResponse?: Object | Function;
      L53:  updateQueries?: MutationQueryReducersMap<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 52
            The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.

      L51:  variables?: Object;
      L52:  optimisticResponse?: Object | Function;
      L53:  updateQueries?: MutationQueryReducersMap<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 53
            'MutationQueryReducersMap' only refers to a type, but is being used as a value here.

      L52:  optimisticResponse?: Object | Function;
      L53:  updateQueries?: MutationQueryReducersMap<T>;
      L54:  refetchQueries?: string[] | PureQueryOptions[];

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 54
            Cannot find name 'string'.

      L53:  updateQueries?: MutationQueryReducersMap<T>;
      L54:  refetchQueries?: string[] | PureQueryOptions[];
      L55:  update?: MutationUpdaterFn<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 54
            'PureQueryOptions' only refers to a type, but is being used as a value here.

      L53:  updateQueries?: MutationQueryReducersMap<T>;
      L54:  refetchQueries?: string[] | PureQueryOptions[];
      L55:  update?: MutationUpdaterFn<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 55
            'MutationUpdaterFn' only refers to a type, but is being used as a value here.

      L54:      refetchQueries?: string[] | PureQueryOptions[];
      L55:      update?: MutationUpdaterFn<T>;

[01:17:51]  typescript: node_modules/apollo-client/core/watchQueryOptions.d.ts, line: 59
            Cannot find name 'T'.

      L58:      [key: string]: any;
      L59:  }> = (proxy: DataProxy, mutationResult: ApolloExecutionResult<T>) => void;

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 11
            Cannot find name 'queryName'.

      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;
      L12:  };

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 11
            Cannot find name 'string'.

      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;
      L12:  };

[01:17:51]  typescript: node_modules/apollo-client/data/mutationResults.d.ts, line: 11
            'MutationQueryReducer' only refers to a type, but is being used as a value here.

      L10:  }> = {
      L11:      [queryName: string]: MutationQueryReducer<T>;
      L12:  };

[01:17:51]  typescript: node_modules/apollo-link-core/lib/link.d.ts, line: 10
            Generic type 'FetchResult' requires 2 type argument(s).

       L9:      concat(next: ApolloLink | RequestHandler): ApolloLink;
      L10:      abstract request(operation: Operation, forward?: NextLink): Observable<FetchResult> | null;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/link.d.ts, line: 12
            Generic type 'FetchResult' requires 2 type argument(s).

      L12:  export declare function execute(link: ApolloLink, operation: GraphQLRequest): Observable<FetchResult>;
      L13:  export declare class FunctionLink extends ApolloLink {

[01:17:51]  typescript: node_modules/apollo-link-core/lib/link.d.ts, line: 16
            Generic type 'FetchResult' requires 2 type argument(s).

      L15:      constructor(f: RequestHandler);
      L16:      request(operation: Operation, forward: NextLink): Observable<FetchResult>;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            Type parameter name cannot be 'string'

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            Type parameter name cannot be 'any'

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            Cannot find name 'E'.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            'Record' only refers to a type, but is being used as a value here.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            Cannot find name 'string'.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            Cannot find name 'any'.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            'ExecutionResult' only refers to a type, but is being used as a value here.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 14
            The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 15
            Cannot find name 'E'.

      L14:  export declare type FetchResult<C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {
      L15:      extensions?: E;
      L16:      context?: C;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 16
            Cannot find name 'C'.

      L15:      extensions?: E;
      L16:      context?: C;
      L17:  };

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 18
            Generic type 'FetchResult' requires 2 type argument(s).

      L17:  };
      L18:  export declare type NextLink = (operation: Operation) => Observable<FetchResult>;
      L19:  export declare type RequestHandler = (operation: Operation, forward?: NextLink) => Observable<FetchResult> | null;

[01:17:51]  typescript: node_modules/apollo-link-core/lib/types.d.ts, line: 19
            Generic type 'FetchResult' requires 2 type argument(s).

      L18:  export declare type NextLink = (operation: Operation) => Observable<FetchResult>;
      L19:   declare type RequestHandler = (operation: Operation, forward?: NextLink) => Observable<FetchResult> | null;

[01:17:51]  dev server running: http://localhost:8100/

[01:17:51]  watch ready in 2.66 s
[01:17:51]  copy finished in 2.65 s

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilkisielacommented, Nov 15, 2017

Since it’s related to apollo-client. I’m closing this one.

1reaction
yordiscommented, Sep 18, 2017

@Alexintosh in your tsconfig

  "lib": [
      "esnext.asynciterable", <-- This should be here and it will fix the issue, hopefully
      "dom",
      "es2015"
    ],
Read more comments on GitHub >

github_iconTop Results From Across the Web

Detect JavaScript errors during compile time using TypeScript ...
We all know that TypeScript is a language that compile itself to JavaScript. During compile-time TypeScript can emit errors to a terminal, ...
Read more >
TypeScript compile error due to typings - Stack Overflow
I'm using typescript 1.7.5, typings 0.6.9 and angular 2.0.0-beta.0. How can I get rid of the typescript compile error messages Duplicate ...
Read more >
Understanding TypeScript Errors for Beginners
Another common mistake amongst TypeScript beginners is to assume that because there are no compile-time errors there will be no run-time errors.
Read more >
Avoid TypeScript errors in your project by using the TypeScript ...
No more unexpected type errors! ... Avoid TypeScript errors in your project by using the TypeScript compiler.
Read more >
TypeScript tool window | WebStorm Documentation - JetBrains
The TypeScript tool window lists compilation errors in TypeScript code. This list is not affected by changes you make to your code and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found