shime / livedown

Live Markdown previews for your favorite editor.
MIT License
765 stars 45 forks source link

Browser Window Opens but No Content #9

Closed salcode closed 9 years ago

salcode commented 9 years ago

I'm running livedown start ./README.md --open --verbose which opens a new tab in Chrome which appears empty.

The url is http://localhost:1337/

Sanity Check

less ./README.md displays the content of the file, leading me to believe my file path is correct

Setup

In the Chrome developer console, I'm seeing

Failed to load resource: net::ERR_CONNECTION_REFUSED  http://localhost/socket.io/?EIO=3&transport=polling&t=1422024891424-0

This error is repeated multiple times.

salcode commented 9 years ago

Looking at the line

http://localhost/socket.io/?EIO=3&transport=polling&t=1422024891424-0

it appears the port (1337 in this example) is missing.

mgrubb commented 9 years ago

I'm having the same exact problem as well. After digging through the code it appears that index.html is being sent without adding the port number in the io.connect() call. This is weird as this was working for me last week and going through the code I can't find anything obvious. However, I do have a patch f48be49029ddab60bd1cc6a8436008ed227a0757 that fixes this.

freethejazz commented 9 years ago

I'm experiencing this as well (through the use of the vim plugin) and am a little wary of not knowing the cause. It seems like this broke for at least the three of us for no reason. I haven't updated the package or plugin and am curious about why it stopped working all of a sudden. Maybe it has to do with side effects relating an upgrade of one of the dependencies?

freethejazz commented 9 years ago

I think the use of ^'s in package.json is the problem. I just removed them all in my local copy of livedown and ran npm install to get the exact version numbers. Things are back to normal now. Rooting through now to figure out exactly which dependency is causing the issue.

freethejazz commented 9 years ago

So the culprit is socket.io version 1.3.2, which really just updates socket.io-client to it's version 1.3.2. @mgrubb, your patch probably addresses that exact issue, but I can't look at it at this moment.

In the mean time, my workaround is to specify the exact version number in the livedown package.json where it's installed. In my case:

$ cd ~/.nvm/v0.10.28/lib/node_modules/livedown
$ vim package.json

# edit the version of socket.io to be "1.3.1", save and quit

$ rm -rf node_modules
$ npm install
mgrubb commented 9 years ago

I wish what I did was as elegant as that :) I just hacked a template handler into server.js to substitute the url into index.html.

Jonathan Freeman mailto:notifications@github.com January 26, 2015 at 5:28 PM

So the culprit is |socket.io| version 1.3.2, which really just updates |socket.io-client| to it's version 1.3.2 https://github.com/Automattic/socket.io-client/commit/ea9b2b72ad989dd0a4df420973a33f33a53dbc77. @mgrubb https://github.com/mgrubb, your patch probably addresses that exact issue, but I can't look at it at this moment.

In the mean time, my workaround is to specify the exact version number in the livedown |package.json| where it's installed. In my case:

|$ cd ~/.nvm/v0.10.28/lib/node_modules/livedown $ vim package.json

edit the version of socket.io to be "1.3.1", save and quit

$ rm -rf node_modules $ npm install |

— Reply to this email directly or view it on GitHub https://github.com/shime/livedown/issues/9#issuecomment-71560797.

salcode commented 9 years ago

@shime I see you've fixed this with #11

When you have a chance would you please tag a new release and push it to npm?

Thanks.

shime commented 9 years ago

Sure, thanks for the ping!

salcode commented 9 years ago

@shime thanks for the quick response, I see 1.0.8 tagged here on GitHub but I'm still seeing 1.0.7 on npm

shime commented 9 years ago

@salcode forgot to publish it on NPM again. It's up now, thanks!

salcode commented 9 years ago

@shime Awesome, thank you.