polymerfire
polymerfire copied to clipboard
FCM subscription fails with Polymer build js: minify=true
Description
When using polymerfire's <firebase-messaging> in a production bundle with minified JavaScript FCM registration fails.
Expected outcome
Registration token for using FCM
Actual outcome
Error in console
code: "messaging/token-subscribe-failed"
message: "Request contains an invalid argument."
Steps to reproduce
follow setup guide for polymerfire messaging
With polymer.json configured
{
"name": "unbundled",
"addServiceWorker": true,
"swPrecacheConfig": "sw-precache-config.js",
"js": {"minify": true},
"css": {"minify": true},
"html": {"minify": true}
}
in terminal polymer serve build/unbundled
in browser enable notifications and check console for errors
Temporary Solution
in polymer.json
set "js": {"minify": false}
Browsers Affected
- [x] Chrome
- [x] Android Chrome
- [x] Opera
- [x] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10
https://github.com/Polymer/polymer-cli/issues/701