Error: Path variable [contenthash] not implemented in this context: [contenthash].css
See original GitHub issueI’m submitting a bug report
- Library Version: 0.33.1
Please tell us about your environment:
-
Operating System: Windows 10
-
Node Version: 8.10.0
-
NPM Version: 5.8.0
-
Browser: all
-
Language: TypeScript X.X
-
Loader/bundler: Webpack
Current behavior:
-
Using Windows 10, I create a new folder and open Powershell.
-
au new --here
with options: 3: Webpack 2: ASP.NET Core 2: Typescript 1: Default - No markeup processing 1: Default - Use standard css 1: None - Skip testing 2: No - Skip testing 1: Visual Studio Code 1: Yes (Default) - Creates the project structure… 1: Yes (Default) - Installs all server, client and tooling dependencies… -
Create app.css with content:
body { background-color: red; }
-
Include css in app.ts:
import './app.css';
-
au build --env prod
gives: Error: Path variable [contenthash] not implemented in this context: [contenthash].css
It seems to be related to: https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/763
I have followed one suggestion from the above link and added mini-css-extract-plugin for latest webpack. This and a few other small changes make my experience with aurelia-cli now much better. Find my changes here: https://github.com/constructor/aurelia-cli-fixes
-
What is the expected behavior? To build without errors using latest libs. As a new user this was causing lots of unnecessary pain. It should just work.
-
What is the motivation / use case for changing the behavior? So it just works.
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (12 by maintainers)
tested with
4.12.0
. issue is still there…@Alexander-Taran After reading around about the wider issues caused by the webpack breaking changes, although my changes work (and I am currently using them) it does not seem to be the correct direction to take. I could elaborate but I will not here. In short the issue comes from the outside. The initial problem, that of newly installed aurelia-cli not working, can be fixed by changing how webpack is referenced in lib/dependencies.json webpack from
"webpack": "^4.1.1"
to"webpack": "4.1.1"
. This solves the major issues in one go (both ‘au run’ and build issues). A hotfix for this would take no time? It is after all a single character change. The other minor issues of css 404 out of the box and project cleaning will still remain, but they are not ‘breaking’ anything and are more minor annoyances for people who like a clean console 😃 I can update my repo tomorrow maybe.