Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor Resource interpreted as Stylesheet but transferred with MIME type text/html

I'm using meteor and I have my static files located in the public directory:

// Directory Structure

app
    app/.meteor
    app/server
    app/client
    app/packages
    app/lib
    app/public
        app/public/styles
        app/public/images

On my index.html, I have this:

<link rel="stylesheet" href="/public/styles/app.css"/>

I still get this error:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/public/styles/app.css".

How can I work my way out of this? What's the proper usage of meteor's public directory?

like image 399
user1966211 Avatar asked Dec 06 '25 17:12

user1966211


1 Answers

You're requesting the incorrect directory. Meteor is serving up HTML as it would with any path that does not point to a file.

The URL path should point to

<link rel="stylesheet" href="/styles/app.css"/>

Everything in public should map to /

like image 94
Tarang Avatar answered Dec 09 '25 10:12

Tarang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!