Skip to content
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

>= 1.10 Doesn't Respect liveReloadBaseUrl #68

Closed
jherdman opened this issue Oct 21, 2018 · 6 comments
Closed

>= 1.10 Doesn't Respect liveReloadBaseUrl #68

jherdman opened this issue Oct 21, 2018 · 6 comments

Comments

@jherdman
Copy link

Ember: 3.5.0

Our apps are delivered in development mode via Nginx at a URL something like this:

http://example.com/some-app
http://example.com/another-app

some-app is, for instance, really found on http://example.com:4206/some-app.

Prior to v1.10+ we could get away with configuring LR as follows in our .ember-cli file:

"liveReloadBaseUrl": "http://example.com:4206/"

In the current versions I can't seem to get the right series of incantations to get this to work any more.

Here's what I've tried:

Host/Port Combo

"liveReloadHost": "http://example.com",
"liveReloadPort": "4206"

Host/Port/ENV VAR

contentFor: function(type) {
let liveReloadPort = process.env.EMBER_CLI_INJECT_LIVE_RELOAD_PORT;
let baseURL = process.env.EMBER_CLI_INJECT_LIVE_RELOAD_BASEURL;
if (liveReloadPort && type === 'head') {
return '<script src="' + baseURL + 'ember-cli-live-reload.js" type="text/javascript"></script>';
}
},
seems to imply I can pass an env var, so above with `export EMBER_CLI_INJECT_LIVE_RELOAD_BASEURL="http://example.com:4206"

Same error.

More Advanced Vars

"liveReloadOptions": {
  "host": "example.com",
  "port": 4206
}

Same error

JS URL

"liveReloadJsUrl": "http://example.com:4206/_lr/livereload.js"

Same error.

Workaround

The work around right now is to downgrade and pin to 1.8.2. I assume the problem is something to do with the middleware configuration for modern Ember.

@rwjblue
Copy link
Member

rwjblue commented Oct 21, 2018

thank you for the awesome write up, would you mind adding another scenario to our tests!

Something like this one:

it('liveReloadPort and port are different', assert => {
options.liveReloadPort = '35729';
let script = InjectLiveReload.dynamicScript(options);
let actual = getScriptSrc(script);
assert.strictEqual(actual, 'http://localhost:35729/_lr/livereload.js?port=35729&host=localhost&path=_lr/livereload');
});

But with the options that you were using? Presumably it fails now (due to not incorporating the port) but having the test helps us 1) make sure we don’t regress in the future, 2) that I actually understand the problem properly 😜

jherdman added a commit to jherdman/ember-cli-inject-live-reload that referenced this issue Oct 21, 2018
@jherdman
Copy link
Author

Sure thing! I've made branch here https://github.com/jherdman/ember-cli-inject-live-reload/tree/issue-68 but I can't seem to open a PR to this repo. Can't say I've had that happen before 😢

@jherdman
Copy link
Author

PR opened! It looks like I was affected by the Github outage.

jherdman added a commit to jherdman/ember-cli-inject-live-reload that referenced this issue Oct 22, 2018
jherdman added a commit to jherdman/ember-cli-inject-live-reload that referenced this issue Oct 22, 2018
jherdman added a commit to jherdman/ember-cli-inject-live-reload that referenced this issue Oct 22, 2018
@rwjblue
Copy link
Member

rwjblue commented Oct 8, 2019

I think this was fixed in #113 (please double check).

@jherdman
Copy link
Author

jherdman commented Oct 9, 2019

Worked like a charm!

@jherdman jherdman closed this as completed Oct 9, 2019
@rwjblue
Copy link
Member

rwjblue commented Oct 9, 2019

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants