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

liveReloadBaseUrl with absolute url no longer supported #33

Closed
wongpeiyi opened this issue Aug 15, 2016 · 11 comments
Closed

liveReloadBaseUrl with absolute url no longer supported #33

wongpeiyi opened this issue Aug 15, 2016 · 11 comments

Comments

@wongpeiyi
Copy link
Contributor

In the past, we could use "liveReloadBaseUrl": "http://localhost:4200/" which is necessary for using ember-cli-deploy for a development workflow, i.e. accessing from http://localhost:3000/

However, with rwjblue@3473a64 this no longer seems to work

Should this be

app.use((options.rootURL || options.baseURL) + 'ember-cli-live-reload.js', // ...

instead?

@jgoclawski
Copy link
Contributor

Hi, I'm the author of the mentioned commit.
There was a refactor before that commit (part of PR #28) and if you take a look at the full index.js file, you will see that:
var baseURL = options.liveReloadBaseUrl || options.rootURL || options.baseURL;

So if you set liveReloadBaseUrl if will be used. Do you say it shouldn't be used?

You said that it no longer seems to work. What are the symptoms? Do you get any errors or any unexpected output in HTML?

@wongpeiyi
Copy link
Contributor Author

Thanks for the response @jgoclawski

To clarify, I'm using the ember-cli-deploy development workflow – index.html served on localhost:3000, ember server running on localhost:4200.

Previously (before your PR), using liveReloadBaseUrl: "http://localhost:4200/" would:

  1. Inject <script src="http://localhost:4200/ember-cli-live-reload.js" type="text/javascript"> (when accessing from localhost:3000)
  2. Because of app.use(options.baseURL + 'ember-cli-live-reload.js', serve the javascript via a relative path, i.e. app.use('/ember-cli-live-reload.js'

This allowed livereload to be served on http://localhost:4200/ember-cli-live-reload.js even when accessing from http://localhost:3000/index.html

With this change to use options.liveReloadBaseUrl, using absolute paths in liveReloadBaseUrl no longer work, because AFAIK app.use doesn't intercept absolute paths, i.e. point (2) above becomes app.use('http://localhost:4200/ember-cli-live-reload.js'

What are the symptoms?

The script is injected but I get a 404 for ember-cli-live-reload.js (because it's not being intercepted)

Do you say it shouldn't be used?

Perhaps using absolute paths in liveReloadBaseUrl was never intended and it worked by mistake in the past. If it's intended to work, perhaps liveReloadBaseUrl should be converted to a relative path before app.use?

Let me know if this makes sense? If needed I can try creating a repo to illustrate

@jherdman
Copy link

For what it's worth, this is biting us too at Precision Nutrition. We've pinned to 1.4.0 in the mean time.

@lukemelia
Copy link
Contributor

Would #36 solve your problem?

@wongpeiyi
Copy link
Contributor Author

@lukemelia yes, thanks -- tested and it works

@pieter-v
Copy link

@lukemelia test failed because now we have the same problem as #35

@wongpeiyi
Copy link
Contributor Author

@pieter-v I did face above as well, but I think it's a separate issue, and can be dealt with in the meantime by defining "liveReloadOptions" in .ember-cli

@pieter-v
Copy link

@wongpeiyi thanks specifying the 'liveReloadOptions' solved the problem

@rwjblue
Copy link
Member

rwjblue commented Jan 19, 2017

Closing (seems like #25, #36 and #40 should have fixed the various issues being discussed).

@rwjblue rwjblue closed this as completed Jan 19, 2017
@aprescott
Copy link

It looks like this was closed because (partially) #36 addresses the problem, however #36 is still open. Since #36 isn't merged/released yet, is there any way around this issue?

@aprescott
Copy link

Ah, I misread a comment above. Pinning to 1.4.0 gets this working with liveReloadBaseUrl set appropriately. It'd be great to run the latest release and still have this functionality though!

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

7 participants