Chunk.entrypoints: Chunks.groupsIterable kullanın ve bunun yerine Entrypoint örneğine göre filtreleyin


91

Uygulamamı başlatmaya çalışırken aşağıdaki hataları görüyorum ...

> css-modules@1.0.0 start /Users/johnnynolan/Repos/css-modules

webpack && open index.html

(node:5706) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Chunk.js:802
        throw new Error(
        ^

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Chunk.js:802:9)
    at /Users/johnnynolan/Repos/css-modules/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
    at Array.forEach (<anonymous>)
    at /Users/johnnynolan/Repos/css-modules/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/johnnynolan/Repos/css-modules/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/johnnynolan/Repos/css-modules/node_modules/tapable/lib/Hook.js:35:21)
    at Compilation.seal (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compilation.js:1203:27)
    at hooks.make.callAsync.err (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compiler.js:547:17)
    at _err0 (eval at create (/Users/johnnynolan/Repos/css-modules/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)
    at _addModuleChain (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compilation.js:1054:12)
    at processModuleDependencies.err (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compilation.js:980:9)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! css-modules@1.0.0 start: `webpack && open index.html`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the css-modules@1.0.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/johnnynolan/.npm/_logs/2018-07-17T14_04_42_021Z-debug.log

css-modülleri bir şeyler atıyor olabilir. Tüm yığın izlemesini ve web paketi yapılandırmanızı
— gönderin

Sorunuzu daha çok "Bunu nasıl çözebilirim?" Satırlarına göre düzenlemenizi öneririm. "Bunu daha önce gören oldu mu?"
— Amy

3
extract-text-plugin Webpack v4 ile çalışmıyor
— IVO GELOV

Yanıtlar:


190
npm install extract-text-webpack-plugin@next

Bu benim için hile yaptı!


1
@Next bana "^ 4.0.0-beta.0" ı getirdi, tam da ihtiyacım olan şeyi. Teşekkür ederim.
— Paula Fleck

82

Buradaki yorumların çoğu https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/701 bunun yerine extract-text-pluginonu değiştirmeyi işaret ediyor mini-css-extract-plugin.

Https://github.com/webpack-contrib/extract-text-webpack-plugin Github deposundanextract-text-webpack-plugin

⚠️ webpack v4'ten beri, extract-text-webpack-eklentisi css için kullanılmamalıdır. Bunun yerine mini-css-extract-eklentisini kullanın.

Başının üzerinde mini-css-extract-plugin/ takas konusunda yükseltin https://github.com/webpack-contrib/mini-css-extract-plugin


21

Evet, web paketiyle aynı sorunu yaşıyorum 4.10.2. Ben takas sonra sorun giderilene extract-css-chunks-webpack-pluginTo mini-css-extract-plugin.

İşte web paketi yapılandırma değişiklikleri:

-const ExtractCssChunks = require('extract-css-chunks-webpack-plugin')
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
  name: 'client',
  target: 'web',
  module: {
    rules: [
      {
        test: /\.css$/,
-       use: ExtractCssChunks.extract({
-         use: 'css-loader'
-       })
+       use: [
+         {
+           loader: MiniCssExtractPlugin.loader,
+         },
+         "css-loader"
+       ]
      }
    ]
  },
// 
// other config........
//
   plugins: [
-    new ExtractCssChunks(),
+    new MiniCssExtractPlugin({
+        filename: `components/[name].css`
+    }),
     //
     // other config........
     //
   ]

Umarım yardımcı olabilir.


Aslında yukarıdaki cevaplardan daha fazlasına yardımcı oldu. Teşekkür ederim.
— Paolo Stefan

7

Ben sürümünü kullanarak hata düzeltildi etmişti 4.0.0-beta.0arasında extract-text-webpack-plugin.


4
4.0.0-beta.0'a güncelleme de sorunumu çözdü
— JillAndMe

VS Code 4.x için otomatik tamamlama özelliğine sahip değildi, bu yüzden bana açık bir sürümle başka bir Google araması kaydettiğiniz için teşekkürler.
— steven87vt

Bu hangi yol?
— Grald
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.