-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMP Shadow with amp-access #10799
Comments
/to @cvializ |
Hi,
the issue is present before the request starts, please take a look to the console messages about tauthorization, it seems that the runtime receives an empty URL. By the way I'll change the endpoint URLs as soon as possible .
Luigi
Inviato da iPhone
… Il giorno 11 ago 2017, alle ore 02:31, Carlos Vializ ***@***.***> ha scritto:
Not sure immediately what the issue is, but after some time I notice that somehow pingback requests do get sent, and the response gives a CORS error. The authorization and pingback endpoints will need the CORS headers added before they will work.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
cc @dvoytenko |
3 |
Hello again! We have found the root cause of this bug and we have a workaround. The bug is caused because there is a variable name collision on the global object between the Google Analytics minified javascript file and the AMP shadow-v0 minified javascript file. Unfortunately the workaround for this is to disable the Google Analytics javascript at the top level of PWA pages with AMP shadow content. As I understand it, you can continue using Google Analytics inside your AMP documents and collect data that way instead. Alternatively, since this collision seems to only affect the pingback feature, you might try using an alternative to that if another solution could fit your use-case. We have a fix we think should work and you can expect a fix in production within the next 10-14 days. Thanks again for your patience while we continue addressing this bug. |
@cvializ: Thank you! We are going to test the suggested workaround and let you know |
I disabled Google Analytics in the PWA and now the authorization and pingback processes work properly. You can test it here: |
@cvializ @justforfun just to stress: the collision affected way more than just pingback. We are fixing it asap, but please keep this in mind. |
When using amp-access in a PWA (Polymer), authorization and pingback are failing
The AMP content is injected in the PWA via amp shadow
On the browser console the following errors appear:
Authorization failed: : Cannot read property 'trim' of undefined
Uncaught (in promise) TypeError: Pingback failed: : Cannot read property 'trim' of undefined
at na (mode.js:56)
at rd (url-parse-query-string.js:31)
at Yj.f.getCorsUrl (url.js:465)
at ak (xhr-impl.js:156)
at Yj.f.sendSignal (xhr-impl.js:288)
at amp-access-client.js:143
at
You can reproduce the issue here:
https://pwa-news.appspot.com/article/chrome/trenta-gradi-e-non-e-finita-il-comune-scatta-l-allerta-1.15504847
The text was updated successfully, but these errors were encountered: