Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Error: Path variable [contenthash] not implemented in this context: style/[name].[contenthash].css #763

@moorthy-g

Description

@moorthy-g

I get the following error after webpack upgrade (4.3.0)
Error: Path variable [contenthash] not implemented in this context: style/[name].[contenthash].css

My plugin config is

new ExtractTextWebpackPlugin({
    filename: 'style/[name].[contenthash].css'
})

extract-text-webpack-plugin's version is 4.0.0-beta.0.

Its working good with webpack 4.1.0 though.

Activity

Alorel

Alorel commented on Mar 27, 2018

@Alorel

This appears to be a conflict with webpack 4.3 which introduced a [contenthash] variable of its own: https://github.com/webpack/webpack/releases/tag/v4.3.0

esausilva

esausilva commented on Mar 27, 2018

@esausilva

I just upgraded to Webpack 4.3 and got the same error. I hope this gets fixed, but for the moment I changed [contenthash] to [hash] to get it working again.

alexander-akait

alexander-akait commented on Mar 27, 2018

@alexander-akait
Member

Please use https://github.com/webpack-contrib/mini-css-extract-plugin for extract css for webpack@4

esausilva

esausilva commented on Mar 27, 2018

@esausilva

@evilebottnawi Thanks. I will give it a try once it supports HMR

Bessonov

Bessonov commented on Mar 28, 2018

@Bessonov

@evilebottnawi does it mean that extract-text-webpack-plugin is deprecated at least for css?

alexander-akait

alexander-akait commented on Mar 28, 2018

@alexander-akait
Member

@Bessonov yes, future ETWP is only extracted content without features like ordering, code splitting, tree shaking, purifying or other specific action for each type of assets (i.e. css/html/etc). Just extract. Thanks!

georgemincof

georgemincof commented on Apr 2, 2018

@georgemincof

A temporary solution that you can use until it's fixed, is to replace [contenthash] with something like [md5:contenthash:hex:20].

catamphetamine

catamphetamine commented on Apr 4, 2018

@catamphetamine

If you're getting this with mini-css-extract-plugin then update it and the error disappears:

npm install mini-css-extract-plugin@latest --save

webpack-contrib/mini-css-extract-plugin#63

4 remaining items

DavOnGit

DavOnGit commented on Sep 2, 2018

@DavOnGit

@esausilva You can check extract-css-chunks-webpack-plugin it supports HMR!

added a commit that references this issue on Dec 12, 2018
xinchanghao

xinchanghao commented on Feb 27, 2019

@xinchanghao

I just upgraded to Webpack 4.3 and got the same error. I hope this gets fixed, but for the moment I changed [contenthash] to [hash] to get it working again.

thanks,resolved

prog1dev

prog1dev commented on Feb 28, 2019

@prog1dev

@evilebottnawi Thanks. I will give it a try once it supports HMR

Why would you use extract-text-webpack-plugin in development?

You dont need HMR in production so switching to https://github.com/webpack-contrib/mini-css-extract-plugin is okay

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

        Participants

        @Bessonov@moorthy-g@catamphetamine@georgemincof@alexander-akait

        Issue actions

          Error: Path variable [contenthash] not implemented in this context: style/[name].[contenthash].css · Issue #763 · webpack-contrib/extract-text-webpack-plugin