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.

Running local server on non-localhost causes breakages

See original GitHub issue

Steps to reproduce:

gulp --host=<insert name of host machine>

navigate to hostname:8000/examples/ads.amp.html Select doubleclick for ad network. Notice how all the ads 404

The issue is that non-localhost is not being identified as localDev in mode.js, which is instead hardcoding localhost in its check for localdev mode.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rsimhacommented, Nov 14, 2017

I believe this is stemming from the hardcoded check for localhost here: https://github.com/ampproject/amphtml/blob/master/src/mode.js#L79

0reactions
rsimhacommented, Jan 8, 2018

Turns out we need to write AMP_CONFIG to the 3p frame as well, for local development with a non-localhost server. Fix available in #12703.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Localhost Refused to Connect Error: 5 Confirmed Ways to Fix It
Localhost refused to connect error can be caused by an incorrectly configured port, insufficient permissions, or an inoperative web server.
Read more >
Layout Looks Good on Localhost, But Breaks on Live Website?
I'm building a new layout in localhost. The layout looks perfectly normal in the local server; no errors, no floating out of parent...
Read more >
Fix automatic re-routing of http:// to https:// on localhost in Web ...
This issue isn't going to bite everyone, but it will cause problems if any of your localhost sites use HSTS security. A good...
Read more >
Errors displaying a hosted website in IIS on a local server with ...
Hi. On a server 2012R2 with IIS 8.5 running, I have a website that works fine on the internet eg https://www.website.co.za/fax/index.asp.
Read more >
Is there an advantage to running code on a localhost as ...
Your application may need to do some heavy processing that is slow in the browser but fast on a server; Recording stats on...
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