最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Meteor Resource interpreted as Stylesheet but transferred with MIME type texthtml - Stack Overflow

programmeradmin3浏览0评论

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?

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?

Share Improve this question asked Feb 6, 2014 at 10:33 user1966211user1966211 8733 gold badges11 silver badges22 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

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 /

发布评论

评论列表(0)

  1. 暂无评论