2

i keep on getting this error in index.d.ts file for firebase ERROR

Error:(18, 18) TS1005:',' expected.
Error:(28, 27) TS1005:',' expected.
Error:(30, 12) TS2314:Generic type 'ErrorFn' requires 2 type argument(s).
Error:(232, 11) TS2314:Generic type 'Observer<T, E, Error>' requires 3 type argument(s).
Error:(239, 11) TS2314:Generic type 'Observer<T, E, Error>' requires 3 type argument(s).
Error:(587, 46) TS2314:Generic type 'Observer<T, E, Error>' requires 3 type argument(s).
Error:(588, 15) TS2314:Generic type 'ErrorFn' requires 2 type argument(s).
Error:(592, 46) TS2314:Generic type 'Observer<T, E, Error>' requires 3 type argument(s).
Error:(593, 15) TS2314:Generic type 'ErrorFn' requires 2 type argument(s).
Error:(701, 24) TS2314:Generic type 'Observer<T, E, Error>' requires 3 type argument(s).

Code

  type ErrorFn<E = Error> = (error: E) => void;
  interface Observer<T, E = Error> 
  error: ErrorFn<E>;
  firebase.Observer<any>

can anyone help me with this, i have been stuck for about a week now

2
  • interface Observer<T, E = Error> { error: ErrorFn<E>; } Commented Aug 29, 2018 at 12:05
  • try add block { } Commented Aug 29, 2018 at 12:06

1 Answer 1

1

It looks like TypeScript is failing on every type parameter default in the file. Upgrade to TypeScript 2.3 or newer, which supports type parameter defaults.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, Struggled for 3 days finally this fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.