add index.css and image to index.html with server-rendering-react-components

83 views Asked by At

I am learning server rendering react currently. And I try to convert a product-landing -page Demo to react with express, babel, Webpack.

There are two problems currently after building and running npm start:

  1. index.css cannot link to index.html, the error in console is :The resource from “http://localhost:3100/index.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
  2. the Logo image in /img cannot load to the index.html.

My folder structure is:

...
-client/App.jsx
       /client.jsx
-dist/client.js
-img(for images)
-public/index.html
       /index.css
-server/index.js
...

The error in console is : The resource from “http://localhost:3100/index.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

My entire code in github: https://github.com/Jo-Zh/Product-Landing-Page.

Can anyone give me some hint? Thanks!

0

There are 0 answers