firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.83k stars 891 forks source link

VSCode Intellisense / AutoComplete is not working #1839

Closed mrfambo closed 5 years ago

mrfambo commented 5 years ago

I read the Issue Template, i am writing the issue in respect of that.

DESCRIBE THE PROBLEM:

I am using Firebase-js-sdk in my react application. The only problem i am having is that intellisense is not working in the VSCode which is leading to severe anxiety and confusion. I need to go back and forth to documentation and get method names etc.

Steps to reproduce:

Just create a react project and add firebase js sdk. Go in your .js file and import the Firebase instance. When you will type "Firebase.", nothing will appear as suggestion. Same goes to "db.", i tried every way out but nothing worked.

Let me know if i can give you more information on this.

mrfambo commented 5 years ago

import * as firebase from "firebase/app";

import 'firebase/auth'; import 'firebase/firestore'; import 'firebase/functions';

var FirebaseConfig = {...REMOVED FOR PRIVACY}

firebase.initializeApp(FirebaseConfig);

when you type "firebase.", after dot nothing is shown as suggestion or autocomplete. Same for other instances.

mrfambo commented 5 years ago

I couldn't get it working even with var firebase = require("firebase/app") etc etc. It is not working anyway no matter ES6 or not.

hsubox76 commented 5 years ago

So I ran

npx create-react-app react-autocomplete
yarn add firebase
code .

and went to src/App.js and pasted in the import lines in your second comment, and autocomplete seems to work:

Screen Shot 2019-06-03 at 2 59 08 PM

Seems like it could be a problem with your VSCode settings, or possibly a VSCode bug. It doesn't seem related to the Firebase JS SDK source code.

mrfambo commented 5 years ago

Leaving a comment for all, removing the node_modules folder and package-lock.json. Then re-installing with yarn solved the problem for me. Seems like VSCode wasn't reaching the package details.