Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get the public folder to work in meteor 0.3.7

Tags:

meteor

All, I have posted this as an issue on Meteor's GitHub page a couple of weeks ago but got no answer. The issue appears so simple that perhaps nobody can believe me.

Here are the steps to reproduce the issue. I have created a brand new vanilla meteor project called "foo" using:

meteor create foo

I have created a folder 'public' in it and copied a picture in it (troll.jpg).

Then I have edited foo.html exclusively to display the picture. I see from meteor's examples that the URL corresponding to content in the public folder is simply / .

<head>
  <title>foo</title>
</head>

<body>
  <img src="/troll.jpg">
</body>

I delete foo.js and foo.css that I don't use.

Then I start meteor and the page just shows a broken image placeholder. The web browser's console (Chrome 20.0.1132.47 for MacOS) says:

Resource interpreted as Image but transferred with MIME type text/html: "http://localhost:3000/troll.jpg". innerhtml.js:80
_htmlToFragment innerhtml.js:80
Meteor.ui.render liveui.js:33
(anonymous function) template.foo.js:1
ready startup_client.js:9

Using Safari I get the same. Meteor's examples on GitHub appear to work without issues. What am I doing wrong? Thanks.

G.

like image 529
giacecco Avatar asked Jul 04 '12 19:07

giacecco


1 Answers

I was getting a similar issue where I thought it was serving font files as text/html mime-type, but it turned out that the route to my font file was wrong. Fixing the route fixed the problem.

It was confusing because the server should be returning a 404 error instead of 200 OK, but it works now.

like image 126
Jorge Pedret Avatar answered Dec 06 '22 07:12

Jorge Pedret