-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
Server not returning some of the files at random #402
Comments
Could you describe which options you included when running |
I have the same problem as well, and I had all options included. |
Same issue here, and chrome is returning error 500s on all the JS files except for jquery osx 10.8.2 |
I'm using Ubuntu as my OS:
|
Same here! work well on apache! |
Any update on this?? I'm still having the same issue |
in chrome I am getting In terminal I am getting
|
@sindresorhus It seems that we have an issue on the @tylershaw Just to check, it would be great if you can try moving that |
HA! @mklabs You are a genius! that fixed it. return function inject(req, res, next) {
// build filepath from req.url and deal with index files for trailing `/`
var filepath = req.url.slice(-1) === '/' ? req.url + 'index.html' : req.url;
// if ext is anything but .html, let it go through usual connect static
// middleware.
if ( path.extname( filepath ) !== '.html' ) {
return next();
}
var port = res.socket.server.address().port;
// setup some basic headers, at this point it's always text/html anyway
res.setHeader('Content-Type', connect.static.mime.lookup(filepath));
// can't use the ideal stream / pipe case, we need to alter the html response
// by injecting that little livereload snippet
filepath = path.join(opts.base, filepath.replace(/^\//, ''));
fs.readFile(filepath, 'utf8', function(e, body) {
if(e) {
// go next and silently fail
return next();
}
body = body.replace(/<\/body>/, function(w) {
return [
"<!-- yeoman livereload snippet -->",
"<script>document.write('<script src=\"http://'",
" + (location.host || 'localhost').split(':')[0]",
" + ':" + port + "/livereload.js?snipver=1\"><\\/script>')",
"</script>",
"",
w
].join('\n');
}); |
haha glad it helped you out. We still need to figure out why we get that nasty undefined error. |
Annnnnddddd you guys are awesome. Thanks! |
Indeed! But how can i use this fix? Should I wait until Yeoman v1.0 will be released? |
This should be fixed in 0.9.1 which is going to be released very soon. |
when i do I'm putting this in this thread because I was trying to see if the changes that were made from this thread were merged yet. |
Yes. The |
Thanks guys for the good work, it's working :) |
yeoman server (on a new project)
Tons of this on the console
TypeError: Cannot read property 'server' of undefined
at Object.inject (/usr/local/lib/node_modules/yeoman/tasks/server.js:408:28)
at next (/usr/local/lib/node_modules/yeoman/node_modules/connect/lib/proto.js:190:15)
at Function.app.handle (/usr/local/lib/node_modules/yeoman/node_modules/connect/lib/proto.js:198:3)
at Server.app (/usr/local/lib/node_modules/yeoman/node_modules/connect/lib/connect.js:60:31)
at Server.EventEmitter.emit (events.js:91:17)
at HTTPParser.parser.onIncoming (http.js:1795:12)
at HTTPParser.parserOnHeadersComplete as onHeadersComplete
at Socket.socket.ondata (http.js:1692:22)
at TCP.onread (net.js:403:27)
at process.startup.processMakeCallback.process._makeCallback (node.js:248:20)
Line 408 of server.py is var port = res.socket.server.address().port;
Some files not being delivered (output from webkit console)
Request URL:http://localhost:3501/scripts/vendor/bootstrap/bootstrap-carousel.js
Request Method:GET
Status Code:500 Internal Server Error
Request URL:http://localhost:3501/scripts/vendor/bootstrap/bootstrap-button.js
Request Method:GET
Status Code:500 Internal Server Error
[.....] (all in the bootstrap dir, which has correct permissions
Also, when accessing the url individually I can see the files, so this can be related to livereload.js / websockets (?)
The text was updated successfully, but these errors were encountered: