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

React SPA Template site.css 404 #839

Closed

Description

@firewave-remo

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.

Activity

  1. SteveSandersonMS commented on Apr 7, 2017

    @SteveSandersonMS
    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 join this conversation on GitHub. Already have an account? Sign in to comment

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