-
Notifications
You must be signed in to change notification settings - Fork 930
Although specifying packages i'm still receiving "It looks like you're using the development build of the Firebase JS SDK" #848
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
Comments
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight. |
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information. |
I'm having the same issue. I'm also using Firebase in a Vuejs project. |
Same here There is something wrong. Documentation does not talk about: import firebase from 'firebase/app';
import 'firebase/<PACKAGE>'; This is not super straight forward to guess that 🤨 |
Hey there all appreciate the issue, but I still have no repro that I have been able to verify. I tried the following and all worked as intended (i.e. no warning message): Get Firebase from NPM$ npm install firebase Add Firebase Components to FileI did this 3 times: Webpack 4I created a file containing the following JS and included it in my app: import firebase from 'firebase/app';
import 'firebase/app';
import 'firebase/firestore';
console.log(firebase); I then compiled this file using webpack 4 (in production mode). Webpack 3I took the same file above and supplied a barebones webpack config that I then ran through webpack 3. The config is below: const { resolve } = require('path');
module.exports = {
entry: resolve(__dirname, 'src/index.js'),
output: {
path: resolve(__dirname, 'dist'),
filename: 'main.js'
}
}; Vue CLII then took a default Vue application and ResultsIn all cases, things worked as expected. No warning message, and minimal app size for what I included. I would recommend looking through your applications to see where you are referencing @MacKentoch we can definitely work on improving our documentation here. I will try and get something figured out to help ASAP. |
I can confirm that centralizing the calls to firebase and doing the following fixed my problem ... import firebase from 'firebase/app' ... so it was probably an errant import that wasn't updated. |
Thanks for prompting me to search through the project. Elsewhere in another file I was referencing firebase mega. Fixed up that reference and all good 👍 |
@run00 and @devpascoe thanks for the due diligence here guys! And best of all you just shaved off a bunch of JS weight for your users 👍 wins all around! |
Thank you @jshcrowthe ! Really appreciate your help and efforts (not easy task to make firebase clear it is such a huge library)! |
Thanks you @jshcrowthe. I'm use firebase for my vuejs projects, import firebase into main.js like this:
Always remember import firebase into your modules like this (IMPORTANT):
DON'T import like this:
DONE. Warning is gone! |
Hi folks! I know the issue is closed, I don't want to open it cause I am not really sure if I should. This is a really small example as a stackblitz to share with you the problem I am facing when importing messaging service. I am getting the warning "It looks like you're using the development build of the Firebase JS SDK...." - Any ideas? Thanks! |
Try this:
Use the firestore & message like this: firestore: message: |
Thanks @jiangtaste but it seems that's not working for me. See the issues: Using "firebase": "5.1.0" as in the stackblitz up here. Any other ideas please? |
@ialex90 I took a look at your stackblitz and noticed just a couple things wrong: I corrected them here: https://stackblitz.com/edit/angular-firebase-messaging-import-vamh9n?file=src/app/app.component.ts Main issues were:
|
Thanks for taking the time and help @jshcrowthe !! |
@ialex90 I have solved that error by this : import * as firebase from 'firebase/app'; |
I still get this message. I have my firebase initialization in one file like this:
Then I import it into other files like this:
What am I doing wrong? |
1stIn the app.component import * as firebase from 'firebase/app';
// Initialize Firebase
const firebaseConfig = {
apiKey: "***",
authDomain: "***",
databaseURL: "***,"
projectId: "***,"
storageBucket: "***",
messagingSenderId: "***"
};
firebase.initializeApp(firebaseConfig); 2ndIn the other files or services you import the 'firebase/app', and the other packages you need, like this : import * as firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/firestore'; 3rdYou use it like this for the authentication, Ex newUser(email: string, password: string) {
return new Promise((resolve, reject) => {
firebase.auth().createUserWithEmailAndPassword(email, password)
.then(() => resolve())
.catch(err => reject(console.log(err.message)));
});
} I hope it help 😄 |
@belachkar This still does not work. I did exactly as you said and looked for any instance of importing firebase instead of firebase/app. I always use firebase/app and auth and firestore after that. I still get the message.
Does this have something to do with using npm install firebase command? Do we npm install the packages separately? |
DON'T: '*' means import everything from 'firebase/app', that's why you got the warning "It looks like you're using the development balabala..." JUST IMPORT 'firebase': I will show you my project's struct with firebase:
|
@jiangtaste This is still not working for me. Is there some other guide somewhere about how to do this? It doesn't make sent to do import "firebase/auth"; Why would you do that? Shouldn't it be import {auth} from "firebase/auth"; or something like that? Why can you import firebase/auth without specifying what you are importing. Why is it that importing "firebase/auth" allows firebase.auth to be used? This is still not working. |
You may check some samples from firebase team. https://firebase.google.com/docs/samples/ |
It's still not working. This is my firebase initialization file:
Then when I import that into another file and us it then it looks like this:
I'm using "firebase": "^5.5.6", |
Hey @nickjuntilla, try configuring your code like so:
Add the |
Try to add this line below;
It works on me successfully |
For those who still struggle
ETC |
with
|
I'am the only one that i'am doing this? |
[REQUIRED] Describe your environment
Operating System version: macOs 10.13.4 and also when deployed to Firebase Hosting
Firebase SDK version: 5.0.3
Firebase Product: app, firestore, messaging (but also occurs when just implementing app)
[REQUIRED] Describe the problem
Receive browser console warning of
"It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.
For the module builds, these are available in the following manner
(replace with the name of a component - i.e. auth, database, etc):"
npm install firebase
then in code:
import firebase from 'firebase/app'
import 'firebase/firestore'
import 'firebase/messaging'
It is part of a Vuejs project but that shouldn't affect anything.
Have also tried deleting node_modules folder and npm install again. Also tried npm installing the individual modules eg, npm install @firebase/app
all had same issue showing the console warning.
The text was updated successfully, but these errors were encountered: