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

React SPA Template site.css 404 #839

Closed
firewave-remo opened this issue Apr 3, 2017 · 1 comment
Closed

React SPA Template site.css 404 #839

firewave-remo opened this issue Apr 3, 2017 · 1 comment

Comments

@firewave-remo
Copy link

Somewhere in the configuration there is a wrong setting.

When you create a clean new react project with Yeoman or with dotnet new react and then running the applicaton you will get a 404 for the site.css File.

In the reactredux template everything is ok.

@SteveSandersonMS
Copy link
Member

If you check your _Layout.cshtml file, you'll see that the React template only references site.css when it's in staging or production modes:

    <environment names="Staging,Production">
        <link rel="stylesheet" href="~/dist/site.css" asp-append-version="true" />
    </environment>

To run your app locally in development (without first running Webpack to produce a production build), you must have the app in development mode, otherwise various things don't work. Not sure if you were following a tutorial or something, but please have a look at this post and its Option 1: Running via the Command Line, or for more general info, see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants