Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path variable [contenthash] not implemented in this context: static/css/[ name].[contenthash].css #2

Open
shuxiayehu opened this issue Apr 6, 2018 · 2 comments

Comments

@shuxiayehu
Copy link

shuxiayehu commented Apr 6, 2018

在clone代码后,运行npm install之后,再运行npm run dev 时会报
npm run dev

[email protected] dev D:\workspace\vue2-koa2-ssr
nodemon code/server/babel.js

[nodemon] 1.17.3
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node code/server/babel.js
(node:7372) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .h ooks instead
server is running at http://192.168.0.105:3000
D:\workspace\vue2-koa2-ssr\node_modules\webpack\lib\TemplatedPathPlugin.js:43
throw new Error(
^

Error: Path variable [contenthash] not implemented in this context: static/css/[ name].[contenthash].css
at fn (D:\workspace\vue2-koa2-ssr\node_modules\webpack\lib\TemplatedPathPlug in.js:43:11)
at fn (D:\workspace\vue2-koa2-ssr\node_modules\webpack\lib\TemplatedPathPlug in.js:31:16)
at String.replace ()
at replacePathVariables (D:\workspace\vue2-koa2-ssr\node_modules\webpack\lib \TemplatedPathPlugin.js:98:5)
at SyncWaterfallHook.eval (eval at create (D:\workspace\vue2-koa2-ssr\node_m odules\tapable\lib\HookCodeFactory.js:17:12), :7:16)
at MainTemplate.getAssetPath (D:\workspace\vue2-koa2-ssr\node_modules\webpac k\lib\MainTemplate.js:387:31)
at Compilation.getPath (D:\workspace\vue2-koa2-ssr\node_modules\webpack\lib\ Compilation.js:1807:28)
at getPath (D:\workspace\vue2-koa2-ssr\node_modules\extract-text-webpack-plu gin\dist\index.js:315:51)
at ExtractTextPlugin.extractedChunks.forEach.extractedChunk (D:\workspace\vu e2-koa2-ssr\node_modules\extract-text-webpack-plugin\dist\index.js:323:83)
at Array.forEach ()
at compilation.hooks.additionalAssets.tapAsync.assetCb (D:\workspace\vue2-ko a2-ssr\node_modules\extract-text-webpack-plugin\dist\index.js:301:25)
at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\workspace\vue2-ko a2-ssr\node_modules\tapable\lib\HookCodeFactory.js:24:12), :7:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (D:\workspace\vue2-koa2-s sr\node_modules\tapable\lib\Hook.js:35:21)
at hooks.optimizeTree.callAsync.err (D:\workspace\vue2-koa2-ssr\node_modules \webpack\lib\Compilation.js:954:32)
at _err0 (eval at create (D:\workspace\vue2-koa2-ssr\node_modules\tapable\li b\HookCodeFactory.js:24:12), :11:1)
at _async2.default.forEach.err (D:\workspace\vue2-koa2-ssr\node_modules\extr act-text-webpack-plugin\dist\index.js:296:11)
[nodemon] app crashed - waiting for file changes before starting...

@Huangshunq
Copy link

把node_modules文件夹删掉,然后命令行敲 yarn,没装yarn就先敲npm i -g yarn

@Anmidan
Copy link

Anmidan commented Jan 9, 2019

contenthash 改成 md5:contenthash:hex:20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants