Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@moredip
Copy link
Contributor

@moredip moredip commented May 10, 2019

Live reload wasn't working for me. I poked around a bit and saw that the live-reload.js wasn't getting injected into the rendered HTML. Reading the connect-livereload docs it looks like that's because it needs to be inserted in the connect middleware stack before any routes that we want it to inject the live-reload.js into:

In your connect or express application add this after the static and before the dynamic routes. If you need liveReload on static html files, then place it before the static routes

I tested this locally and it fixed things for me - live-reload wasn't working before, and is now.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 280

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 68.873%

Totals Coverage Status
Change from base Build 278: -0.1%
Covered Lines: 317
Relevant Lines: 435

💛 - Coveralls

@F1LT3R
Copy link
Collaborator

F1LT3R commented May 11, 2019

What happens if you use this in conjunction with the live reload browser plugin?

@moredip
Copy link
Contributor Author

moredip commented May 11, 2019

Oh, good question. I don't have the extension so I didn't check. Happy to install it and test that. Ok if I just test with Chrome, or do you think I should check extensions on other browsers too?

@moredip
Copy link
Contributor Author

moredip commented May 11, 2019

I installed the Chrome LiveReload extension and tested this out. Seemd to work as expected.

  • Without this PR, with extension on: live reload worked
  • Without this PR, with extension off: live reload didn't work
  • With this PR, with extension on: live reload worked
  • With this PR, with extension off: live reload worked

I also fired up the network tab in devtools to see if the page gets reloaded twice, or something like that, and didn't see anything fishy.

I'm assuming that the live-reload.js that's injected by connect-livereload will not activate if it detects that the livereload extension is already active.

@F1LT3R
Copy link
Collaborator

F1LT3R commented Jun 16, 2019

Hey thanks for this! Sorry about the delay. Big delivery at work. I'll try and get to this in the next couple of days.

@moredip
Copy link
Contributor Author

moredip commented Jun 16, 2019

No need to apologize! You're the one maintaining awesome free software for anyone to use that wants it!

@mreishus
Copy link
Contributor

+1, I had problems with live reload working and manually making this change fixed it for me.

Copy link
Collaborator

@F1LT3R F1LT3R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look great! Working well. Thanks for submitting this.

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

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.