question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Path variable [contenthash] not implemented in this context: [contenthash].css

See original GitHub issue

I’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:

  1. Using Windows 10, I create a new folder and open Powershell.

  2. 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…

  3. Create app.css with content: body { background-color: red; }

  4. Include css in app.ts: import './app.css';

  5. 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:closed
  • Created 5 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
avrahamcoolcommented, Jun 14, 2018

tested with 4.12.0. issue is still there…

3reactions
constructorcommented, Apr 12, 2018

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Path variable [contenthash] not implemented in this ...
I get the following error after webpack upgrade (4.3.0) Error: Path variable [contenthash] not implemented in this context: style/[name].
Read more >
Path variable [contenthash] not implemented in this context ...
When using [hash] placeholder in webpack configuration, consider changing it to [contenthash]. It is not the same, but proven to be more ...
Read more >
Error: Path variable [contenthash] not implemented in this context
1) Using Windows 10, I create a new folder and open Powershell. · 2) au new --here with options: 3: Webpack 2: ASP.NET...
Read more >
Path variable [contentHash:8] not implemented in this context
Path variable [contentHash:8] not implemented in this context: styles.[contentHash:8].css. webPack 升级到4.x导致 extract-text-webpack-plugin ...
Read more >
MiniCssExtractPlugin
This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found