question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong 3P frame.html loaded when testing local compiled binary

See original GitHub issue

All 3P frames are loading //ampproject.net/dist.3p/1513120604167/frame.html. This might be due to this change #12152 , which sets config.localDev=true, hence triggered the following logic in 3p-frame.js:

function getAdsLocalhost(win) {
  if (urls.localDev) {
    return `//${urls.thirdPartyFrameHost}`;
  }
  return 'http://ads.localhost:'
      + (win.location.port || win.parent.location.port);
}

To reproduce,

gulp dist --fortesting
gulp serve --fortesting --compiled

then load page http://localhost:8000/examples/ads.amp.html

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lannkacommented, Dec 13, 2017

I do expect localDev to be true (originally proposed here.

And I agree the fix should be somewhere getAdsLocalhost.

What is unclear to me is the current relation between getMode().LocalDev vs AMP_CONFIG.localDev.

If we can consolidate these 2 variables, then we can probably get rid of this getAdsLocalhost function.

0reactions
rsimhacommented, Dec 14, 2017

I agree that the logic is complicated. This is because the config is written during build time, and returned at runtime. I wonder how they can be consolidated without a file read.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Load local javascript file in chrome for testing? - Stack Overflow
In my case I need a html page that runs locally but still needs to load json files. I cannot tweak my Chrome...
Read more >
VbS - River Thames Conditions - Environment Agency - GOV.UK
Shill bidding ebay uk, Envision math topic 6 test, Fastest charger for iphone, Foto spiagge isola d'elba! E-gitarre solo lied, Garage pour moto...
Read more >
2010-October.txt - GCC, the GNU Compiler Collection
So far I have partial success with updating the toolchain to binutils 2.17+gcc 4.1.2+newlib 1.15: - I can compile binaries with the gcc...
Read more >
Changelog - curl
... tests: add HTTP/3 test case, custom location for proper nghttpx ... mbedtls: fix compile when h2-enabled; mbedtls: fix some error messages ...
Read more >
Consolidated JDK 8 Release Notes - Oracle
getCpuLoad() returns incorrect CPU load inside a container ... JDK-8271854, core-libs, java.nio, Explicitly reclaim cached thread-local direct buffers at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found