tools: js minify breaks polymerfire
Description
building with "js": { "minify": true } breaks polymerfire. Cannot read the database anymore and get error messages like: FIREBASE INTERNAL ERROR: Server Error: ClientId[7309775]:ErrorId[966]: Error on incoming message .
Just replacing the files in build/min/bower_components/firebase/ by original files (firebase-app.js, firebase-database.js, firebas-auth.js … which are already minified) makes the app work again.
As an - unsuccessful - workaround, I tried to upgrade babel-preset-babili to the latest version (0.0.12), and unset all babel-preset-options ({boolean: false, buildIn, false, ...} as in https://github.com/Polymer/polymer-cli/pull/698).
Is there a way to prevent some files to be minified during the build process?
Versions & Environment
- Polymer CLI: 0.18.1
- node: 6.10.1
- Operating System: Linux
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 29 (9 by maintainers)
Commits related to this issue
- disable js minify (Polymer/polymer-cli/issues/701) — committed to GDGKualaLumpur/ioxkl17 by limhenry 7 years ago
There is now a PR for skipping minification of problematic js files: https://github.com/Polymer/polymer-cli/pull/878
I am getting exactly the same error as @homerjonathan when trying to log in with Google using polymerfire after building with
es5-bundledpresetsEven though this is a problem with the minifier, wouldn’t it be good to be able to not minify certain scripts, especially when you have 3rd party redistributable scripts with a version and a license like in the Firebase scripts?
I also found --js-minify breaks the polymerfire in the build process. Error reported when firebase-auth called: Uncaught TypeError: Cannot read property ‘signInWithEmailAndPassword’ of undefined at HTMLElement.signInWithEmailAndPassword (firebase-auth.html:1) at HTMLElement.signIn (my-app.html:1) at HTMLElement.S (polymer.html:1) at HTMLElement.fire (polymer.html:1) at HTMLElement.signIn (pd-login.html:1) at HTMLElement.S (polymer.html:1) at HTMLElement.fire (polymer.html:1) at Object.fire (polymer.html:1) at Object.forward (polymer.html:1) at Object.click (polymer.html:1) I copied in ./bower_components/polymer/polymer.html to ./build/default/bower_components/polymer and the app works OK. Something breaks in minimising polymer.html? polymer cli 0.18.1 polymer 1.9.1 polymerfire 0.10.4 (version required by polymer-cli)
This is my temporary fix… to [install_dir]/polymer-cli/lib/build/optimize-streams.js (e.g. /usr/local/lib/node_modules/polymer-cli/lib/build/optimize-streams.js)
I am getting the same error using “google” as the provider of security.
Here is the authentication code I am using.
I get the same error report with Uncaught TypeError: Cannot read property ‘length’ of undefined
Interestingly I get a blank sign-up box as well.
Also getting this error on v1.2.0 – just brought our production build to a halt.
@christophe-g’s fix doesn’t seem to work for us, nor does building with the following flags:
Which is odd, because I thought this problem was related to minification.
Same With v1.2.0, I get
Cannot read property 'length' of undefinedexceptions. Any clean solution other than @christophe-g solution ?!Seeing this on v1.3.1 as well.
Hey @eob In my case it was the HTML minification. Maybe this is a mix of other problems.
I also see this problem with polymer cli v1.1.0 and after updating to polymerfire v2.1.0
firebase-auth.js:1 Uncaught TypeError: Cannot read property 'length' of undefined at Ss.o.dispatchEvent (firebase-auth.js:1) at _s (firebase-auth.js:1) at Ss.ne (firebase-auth.js:1) at Ss.send (firebase-auth.js:1) at _l.Mf (firebase-auth.js:1) at Wl (firebase-auth.js:1) at firebase-auth.js:1 at new ur (firebase-auth.js:1) at ql (firebase-auth.js:1) at firebase-auth.js:1