# Aurelia CLI project possible error

**URL:** <https://discourse.aurelia.io/t/aurelia-cli-project-possible-error/1881>\
**Category:** Uncategorized\
**Created:** [November 12, 2018, 7:03pm UTC](https://discourse.aurelia.io/t/aurelia-cli-project-possible-error/1881 "2018-11-12T19:03:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![constructor](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/constructor/32/710_2.png) [@constructor](https://discourse.aurelia.io/u/constructor)\
**Post date:** [November 12, 2018, 7:03pm UTC](https://discourse.aurelia.io/t/aurelia-cli-project-possible-error/1881/1 "2018-11-12T19:03:32Z")

</div>

I will keep this as short as possible.

Using Visual Studio 2017 (latest updates as of post date).

1. I created an MVC core project.

2. I created an Aurelia project via the CLI inside this project.

3. Following the CLI instructions made the changes to the Home/Index view :

4. Build the aurelia project and CTRL-F5 to run the MVC project. The Aurelia app does not load.

Why?

In the webpack.config.js, lines 43-45 inclusive:

```
filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js'

```

The development bundle names have a [hash]. The Index.cshtml does not expect one:

```
  <environment names="Development">
    <script type="text/javascript" src="~/dist/vendor.bundle.js" asp-append-version="true"></script>
    <script type="text/javascript" src="~/dist/app.bundle.js" asp-append-version="true"></script>
  </environment>

```

Removing the ‘[hash]’ from the development build webpack.config.js, lines 43-45 and things work again.

There is still a 404 on ‘vendor.css’ on a newly created project.

---

<div class="post-metadata">

**Author:** ![constructor](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/constructor/32/710_2.png) [@constructor](https://discourse.aurelia.io/u/constructor)\
**Post date:** [November 12, 2018, 8:12pm UTC](https://discourse.aurelia.io/t/aurelia-cli-project-possible-error/1881/2 "2018-11-12T20:12:29Z")

</div>

Regarding the 404 on ‘vendor.css’ on a newly created project.

I have changed the ‘\_Layout\_App.cshtml’ file to include a RederSection for css:

```
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>@ViewData["Title"] - Aurelia</title>
  @RenderSection("css", required: false)
</head>
<body>
  @RenderBody()

  @RenderSection("scripts", required: false)
</body>
</html>

```

This is used by the ‘Index.cshtml’ file as follows.

```
@section css {
  <environment names="Production">
    <link asp-href-include="~/dist/*.css" rel="stylesheet" asp-append-version="true"/>
  </environment>
}

```

CSS now seems to be handled correctly both in ‘dev’ and ‘prod’ builds with the 404 error gone and the redundant ‘vendor.css’ removed.

---

<div class="post-metadata">

**Author:** ![constructor](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/constructor/32/710_2.png) [@constructor](https://discourse.aurelia.io/u/constructor)\
**Post date:** [November 15, 2018, 8:15pm UTC](https://discourse.aurelia.io/t/aurelia-cli-project-possible-error/1881/3 "2018-11-15T20:15:52Z")

</div>

> **[constructor/au\_template\_dotnetcore\_2.1.0](https://github.com/constructor/au_template_dotnetcore_2.1.0)**
>
> Aurelia CLI template with fixes. An Aurelia CLI template generated over a MVC dot net core 2.1.0 Visual Studio template. - constructor/au\_template\_dotnetcore\_2.1.0

1. Clone.
2. ‘yarn build’
3. ‘dotnet run’
