ibash
ibash

Reputation: 1517

Why is meteor only returning an empty file?

I'm using Meteor.js for a new project.

It was working at first, but now when I run meteor it seems to start fine, but when I go to localhost:3000 my browser automatically downloads an empty file.

I tried clearing my cache, restarting my computer, reinstalling node and reinstalling meteor. I also tried running the meteor example apps, and creating a new app no matter which one I get the same result of an empty file being downloaded. At wits end, any ideas?

I'm on OS X lion using Google Chrome.

Edit:

So, after messing around some more, I'm able to run the examples in /usr/local/meteor/examples if I use sudo meteor --port <some arbitrary port>.

When I try that with my app though, it says it's running but I still get nothing.

Headers from curling localhost on the example apps give:

HTTP/1.1 200 OK
content-type: text/html
connection: close
transfer-encoding: chunked

While my headers are:

HTTP/1.1 200 OK
date: Mon, 11 Jun 2012 00:51:47 GMT
cache-control: public, max-age=31536000
last-modified: Sun, 10 Jun 2012 10:36:37 GMT
etag: "0-1339324597000"
content-type: application/octet-stream
accept-ranges: bytes
content-length: 0
connection: close

Edit2: It looks like I get a proper error page if I explicitly throw an error. But, if there are no errors then my headers are wrong.

Edit3:* Or possibly it's an error with my environment, example apps no longer run and I get Unexpected mongo exit code 127. Restarting.

Edit4:* Okay, so the mongo error was unrelated. I've tracked the problem back to gzippo, specifically if I comment out: app.use(gzippo.staticGzip(path.join(bundle_dir, 'static_cacheable'), {clientMaxAge: 1000 * 60 * 60 * 24 * 365})); in /usr/local/meteor/app/server/server.js

and then have a CLEAR cache (start a new private session) it works! if my cache isn't clear, a blank file is still served.

So, the static_cacheable directory isn't created which is why gzippo prompts a empty download.

I'm not sure whether this should be patched in meteor's server.js or bundler.js ... going to file a bug

Upvotes: 2

Views: 1511

Answers (1)

ibash
ibash

Reputation: 1517

Filed an issue: https://github.com/meteor/meteor/issues/177 and made a fix: https://github.com/meteor/meteor/pull/179

It's a problem where a folder (static-cacheable) gzippo expects is not created by meteor. relevant files in meteor: app/server/server.js:61, app/lib/bundler.js:526

Upvotes: 8

Related Questions