polymerfire icon indicating copy to clipboard operation
polymerfire copied to clipboard

FCM subscription fails with Polymer build js: minify=true

Open ackushiw opened this issue 8 years ago • 1 comments

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

ackushiw avatar Apr 27 '17 19:04 ackushiw

https://github.com/Polymer/polymer-cli/issues/701

khammami avatar Apr 28 '17 10:04 khammami