-
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-toolbox/optimizer should set AMP_CONFIG URLs when self-hosting AMP JS #24927
Comments
Hm, do we suggest self-hosting AMP JS anywhere e.g. in documentation? This may be uncharted territory. This can technically be done by prepending a custom |
The amp-toolbox Setting |
Thanks. Sounds like the optimizer should be prepending /cc @sebastianbenz |
Or @sebastianbenz can do it because I don't have access. :) |
Thank you for the tip @choumx . Could you point me to an AMP page that has |
I haven't solved this puzzle yet. It looks to me like The updated minimal example that was previously here was moved to the original post on 2019-10-07 |
Thanks for filing this Matt! This will also become relevant once we will officially support self-hosting the runtime. It'd be nice to have a way to do this that doesn't require rewriting the runtime bundles. Maybe //cc @honeybadgerdontcare P.S. Sorry, for the issue transferral noise (should've read to the end first). |
@mattwomple Right, you'd need to overwrite the |
The bulk of my original issue report is remedied by setting an environment variable before loading
PR #25026 brings amphtml's extension URL generation in-line with amp-toolbox/optimizer. |
That's a good workaround. |
Closing in favor of #25873. |
What's the issue?
When AMP pages that have been optimized using the amp-toolbox transformer are loaded into a PWA using
shadow-v0.js
, any self-hosted AMP runtime URLs for AMP extensions are ignored andcdn.ampproject.org
is used instead.How do we reproduce the issue?
Edited 2019-10-07 with much simpler sample.
A minimal example PWA that illustrates this issue is available at:
shadow-v0.js
is set to pull from a self-hosted runtime, regardless of AMP page loaded.These HTML files, along with the simple node.js script that transformed
-amp.html
to-opt.html
is available in github.com/mattwomple/self-hosted-amp-pwa.Watch the network traffic when loading
self-hosted-amprt-amp.html
. You should seev0.js
andamp-form-0.1.js
are requested fromhttps://amp-android.cmphys.com/7769/amp-dist/
. Note:amp-auto-lightbox-0.1.js
loads fromcdn.ampproject.org
because it is added dynamically; this is another issue for another day.Next, watch the network traffic when loading
self-hosted-amprt-pwa.html
. Noticeshadow-v0.js
is requested fromhttps://amp-android.cmphys.com/7769/amp-dist/
butamp-form-0.1.js
is requested fromhttps://cdn.ampproject.org/rtv/011909141409590/v0/
. This is what I hope can be fixed.What browsers are affected?
All browsers. Tested on Chrome 77.
Which AMP version is affected?
1909141409590
The text was updated successfully, but these errors were encountered: