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

Live Reload not working when not using Ember CLI server to serve assets #13

Closed
patocallaghan opened this issue Oct 17, 2014 · 6 comments

Comments

@patocallaghan
Copy link

Hey,

I've just updated our project to the latest Ember-CLI and with the latest version of this package (1.3.0) the live-reload is not working anymore. I guess this is due to our unconventional setup for a dev environment. We don't use the ember-cli server to serve our assets, instead we symlink the ember-cli dist directory with the public directory of our rails app in another directory.

//Edit Ember files here, dist is symlinked with dist in rails_app directory
-- ember_cli_app
  -- dist

-- rails_app
  -- public
    -- dist

In the ember-cli index.html the live-reload url is /ember-cli-live-reload.js but this 404s when we try to access it through our rails app as it doesn't know how to handle this url. I then tried to set up a redirect in the rails app from /ember-cli-live-reload.js to http://localhost:35729/livereload.js?snipver=1 which finds the required file. But the problem then is that livereload gives the following errors:

LiveReload disabled because it could not find its own <SCRIPT> tag livereload.js?snipver=1:858LiveReload livereload.js?snipver=1:858

Uncaught TypeError: Cannot read property 'addPlugin' of undefined livereload.js?snipver=1:965

I guess this is due to the fact that we are no longer dynamically inserting the http://localhost:35729/livereload.js?snipver=1 script tag into the page and just redirecting to it.

Do you have any suggestions what we can do here? Or is there any way to have some config to choose which type of dynamic insertion you want to happen?

Thanks,
Pat

EDIT: I've moved back to version 1.2.3 for the time being to get it working again.

@patocallaghan patocallaghan changed the title Live Reload redirect not working when not using Ember CLI server Live Reload not working when not using Ember CLI server Oct 17, 2014
@patocallaghan patocallaghan changed the title Live Reload not working when not using Ember CLI server Live Reload not working when not using Ember CLI server to serve assets Oct 17, 2014
@jvtrigueros
Copy link

I can confirm that reverting back to version 1.2.3 makes LiveReload work once again.

@john-kurkowski
Copy link

Same problem here. Downgrading to 1.2.3 works flawlessly. No /ember-cli-live-reload.js redirect necessary.

@pixelhandler
Copy link

@patocallaghan See #15 and #18 perhaps you'll be able to use v1.3.1 if your server can handle the proxy to port 4200 for the /baseURL/ember-cli-live-reload.js request

@elucid
Copy link

elucid commented Apr 10, 2015

Not having to use a proxy to work around serving from a different URL would be useful. This issue outlines one use case, http://discuss.emberjs.com/t/is-it-possible-to-use-ember-clis-live-reload-support-from-nitrious-io/6419 is another.

@rwjblue would you accept a PR adding a liveReloadHost option? This could get prepended to options.baseUrl in serverMiddleware

@ghost
Copy link

ghost commented Jun 10, 2015

alternatively, you could serve the livereload.js file yourself, and then pass the port and host options directly to the script like so http://example.org/livereload.js?host=localhost (note: it also supports a parameter to configure the websocket port)

You can get the livereload script from livereload-js package. It's been decoupled from tinylr for awhile.

@rwjblue
Copy link
Member

rwjblue commented Jan 19, 2017

I believe that this should mostly work now. See #25 and the README for details.

I'm happy to reopen if I'm mistaken, but closing for now...

@rwjblue rwjblue closed this as completed Jan 19, 2017
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

6 participants