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

Broken types #2943

Closed
TrejGun opened this issue Apr 19, 2020 · 4 comments
Closed

Broken types #2943

TrejGun opened this issue Apr 19, 2020 · 4 comments

Comments

@TrejGun
Copy link

TrejGun commented Apr 19, 2020

this is crosspost from origial issue
import-js/eslint-plugin-import#1673

can you guys, please, work together and fix typings or at least share your thoughts because this is really frustrating right now

Details:

following code throws error in eslint-plugin-import

import * as firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/firestore'
import 'firebase/storage'

import config from './production.config'


if (!firebase.apps.length) {
  firebase.initializeApp({
    ...config,
    timestampsInSnapshots: true,
  })
}

export default firebase
TypeError: moduleDecl.body.body.forEach is not a function
Occurred while linting ~/services/admin-website/src/views/Products/Products/AddProductDialog/PhotoInput/index.tsx:1
at ~/node_modules/eslint-plugin-import/lib/ExportMap.js:565:32
at Array.forEach (<anonymous>)
at ~/node_modules/eslint-plugin-import/lib/ExportMap.js:563:19
at Array.forEach (<anonymous>)
at Function.ExportMap.parse (~/node_modules/eslint-plugin-import/lib/ExportMap.js:477:12)
at Function.ExportMap.for (~/node_modules/eslint-plugin-import/lib/ExportMap.js:361:25)
at resolveImport (~/node_modules/eslint-plugin-import/lib/ExportMap.js:415:25)
at Object.<anonymous> (~/node_modules/eslint-plugin-import/lib/ExportMap.js:422:14)
at processBodyStatement (~/node_modules/eslint-plugin-import/lib/rules/namespace.js:89:38)
at Array.forEach (<anonymous>)

because of unexpected ast tree

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

@hsubox76
Copy link
Contributor

hsubox76 commented Apr 20, 2020

Can you please create a minimal repro that produces the same error? Just a small repo with the minimum set of files and instructions to reproduce. It's very hard to debug without the context of the rest of the files involved, or your build setup.

Edit: On further examination, it appears this is not an issue with Firebase, but with eslint parser. Your code is perfect Typescript/Javascript.
Closing because it is not a SDK issue.

@TrejGun
Copy link
Author

TrejGun commented Apr 21, 2020

@hsubox76 can you please point out which statement is being parsed int he wrong way? so i can create issue in appropriate place?

@hsubox76
Copy link
Contributor

Unfortunately I don't have the knowledge about this eslint plugin needed to debug it, and issues in this repo are supposed to be for reporting and discussing bugs in this repo only.

I would suggest removing one import line at a time and seeing if it works, or other standard debugging techniques. If you need help or advice on how to debug, Stack Overflow might be the best place to ask.

@firebase firebase locked and limited conversation to collaborators May 21, 2020
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

3 participants