Skip to content
This repository was archived by the owner on Apr 9, 2019. It is now read-only.
This repository was archived by the owner on Apr 9, 2019. It is now read-only.

Refused to apply style from 'http://localhost:7001/umi.css'  #2

@kennylbj

Description

@kennylbj

I am using egg-view-static to serve static html resource built by create-umi . The built files was located in app/public dir and the following errors occured when i start the egg server and visit http://localhost:7001.

Refused to apply style from 'http://localhost:7001/umi.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Here is the configs:

// config/config.default.js
module.exports = appInfo => {
  const config = exports = {};

  config.keys = appInfo.name + '12345';

  config.view = {
    defaultViewEngine: 'static',
    mapping: {
      '.html': 'static',
    },
  }

  config.security = {
    csrf: false,
  };

  return config;
};
// config/plugin.js
exports.viewStatic = {
  enable: true,
  package: 'egg-view-static',
};

Is there something i miss?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions