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

Did Firebase.js 7.x break compatibility with Typescript 2.6.x? #2335

Closed
zarko-tg opened this issue Nov 4, 2019 · 5 comments
Closed

Did Firebase.js 7.x break compatibility with Typescript 2.6.x? #2335

zarko-tg opened this issue Nov 4, 2019 · 5 comments

Comments

@zarko-tg
Copy link

zarko-tg commented Nov 4, 2019

Reposting from SO (https://stackoverflow.com/questions/58657228/did-firebase-js-7-x-broke-compatibility-with-typescript-2-6-x) since we aren't getting anywhere.

(All) Ionic 3 apps cannot compile since Firebase 7.0.0. Was compatibility with Typescript 2.6.x abandoned without checking or informing about it?

Steps to reproduce:

  1. npm i -g ionic
  2. cd ~/temp && ionic start i3 blank --type=ionic-angular && cd i3
  3. npm i firebase
  4. Add the following line along the other imports in src/app/app.component.ts
    import * as firebase from 'firebase/app';
  5. ionic serve

Compilation fails, see the SO issue for output log.

The pretty standard tsconfig.json used is:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5"
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "src/**/*.spec.ts",
    "src/**/__tests__/*.ts"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

Environment:
Ionic CLI : 5.4.5
Ionic Framework : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.2
NodeJS : v12.13.0
npm : 6.12.0
OS : macOS Catalina

@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@zarko-tg zarko-tg changed the title Did Firebase.js 7.x broke compatibility with Typescript 2.6.x? Did Firebase.js 7.x break compatibility with Typescript 2.6.x? Nov 4, 2019
@hsubox76
Copy link
Contributor

hsubox76 commented Nov 5, 2019

Yes, it did break compatibility with Typescript versions prior to 2.8. It wasn't intentional, but we used a conditional type for analytics that is not recognized by pre-2.8 versions of Typescript. Are you able to upgrade your Typescript version? I was able to npm i typescript@latest in my test Ionic project and run it successfully but I don't know if you have other constraints that prevent you from upgrading.

We are looking into what we might be able to do to fix it for users of earlier Typescript versions but if you are able to safely upgrade Typescript to 2.8+ this may be the quickest way to unblock you for now.

@zarko-tg
Copy link
Author

zarko-tg commented Nov 5, 2019

Thank you for the quick response. I don't think it's a viable option (for larger Ionic/projects) but I can give it a go (again) asap.

@zarko-tg
Copy link
Author

zarko-tg commented Nov 5, 2019

We'll try out running with TS 2.8.4 as the compilation seems fine with it.
You probably want this minimum requirement documented (someplace right).

Feel free to close this issue when you see fit.

@rommelpe
Copy link

Thanks for the input, @zarko-tg. We are pleased to let you know that we have added this info on our release notes.

Breaking change: For TypeScript users, the required minimal TypeScript version is 2.8.0.

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

No branches or pull requests

4 participants