Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Firebase Error for Web! #365

Closed
emjimadhu opened this issue Aug 21, 2017 · 8 comments
Closed

Firebase Error for Web! #365

emjimadhu opened this issue Aug 21, 2017 · 8 comments

Comments

@emjimadhu
Copy link

i am using firebase. When building for desktop, there is no problem. But when i build for web, there was no error when building for web. but when i use webapp, i get this error

screenshot from 2017-08-16 13-35-08

and when i look at the web.js and i found that firebase cofig was commented (i know its not intentionally doing that) but how can i avoid that?

screenshot from 2017-08-16 13-36-10

@SimulatedGREG
Copy link
Owner

@emjimadhu

It seems, for whatever reason, that the web build is bundling the firebase-node script instead of the needed firebase-browser script. I'm not entirely sure what may be causing that. Maybe you could try importing the firebase/app module and see if you get different results. As for the comment issue from the second screen shot you posted, you can ignore that since the editor isn't actually highlighting correctly.

@emjimadhu
Copy link
Author

@SimulatedGREG sorry for the late reply, i tried firebase/app import in my app. but now it says that i didnt initialize the firebase app with configuration which i clearly did and the same configuration works for normal firebase import. what would be the problem?

@SimulatedGREG
Copy link
Owner

Do you have a project repo I could take a look at?

@emjimadhu
Copy link
Author

@SimulatedGREG im sorry, original project is private. but i created new one, it has the same error when i built for web.. here is the repo.

https://bitbucket.org/emjimadhu/firebase-sample

@SimulatedGREG
Copy link
Owner

@emjimadhu

Okay, this is a doozie. In short, this is a bug with babel-minify (https://github.com/Polymer/polymer-cli/issues/701, babel/minify#574). Current workaround is to use Uglify for the web configuration. Remove new BabiliWebpackPlugin() from webpack.web.config.js, and replace with the following...

new webpack.optimize.UglifyJsPlugin({
  ecma: 8
})

@jukbot
Copy link

jukbot commented Sep 5, 2017

so for temporary solution is set minify in to false right?

i'm using polymer-cli and also have this issue too, thus i've to set build option in polymer.json

"js": {
      "minify": false
    },

this problem is still an issue with the polymerfire (firebase) library.

@SimulatedGREG
Copy link
Owner

SimulatedGREG commented Sep 6, 2017

@jukbot

For the case of polymer-cli projects, disabling minification would fix the issue, but I personally wouldn't recommend shipping code that isn't minified..

@emjimadhu
Copy link
Author

@SimulatedGREG thank you so much.. It's working now.. thanks a lot..

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