Electron-vue: Firebase Error for Web!

Created on 21 Aug 2017  路  8Comments  路  Source: SimulatedGREG/electron-vue

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

dep-issue

All 8 comments

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

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

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

@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

@emjimadhu

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

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

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.

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jt-wang picture jt-wang  路  3Comments

xiaomizhou66 picture xiaomizhou66  路  3Comments

Oriol-GG picture Oriol-GG  路  3Comments

Oriol-GG picture Oriol-GG  路  3Comments

michalzaq12 picture michalzaq12  路  3Comments