Ошибка веб-пакета: Дочерняя компиляция не удалась: Не удалось прочитать свойство 'sort' из неопределенного: - PullRequest
0 голосов
/ 20 июня 2019

При переходе на веб-пакет версии 4 из версии 2 я вижу нижеуказанную ошибку как неопределенную.Не могу найти, чтобы найти проблему.

Ниже приведена моя конфигурация веб-пакета

    new HtmlWebpackPlugin({
        template: './src/app/sample-error.ejs',
        chunksSortMode: 'dependency',
        filename: 'jpmol-error.html',
        chunks: [
            'polyfills',
            'styles-jpmol',
            'main-jpmol-error'
        ]
    }),

Ниже указана ошибка, которую я получаю при попытке запустить сервер разработки веб-пакета.

ERROR in   Error: Child compilation failed:
  Cannot read property 'sort' of undefined:
  TypeError: Cannot read property 'sort' of undefined

  - compiler.js:79 
    [action-center-ui]/[html-webpack-plugin]/lib/compiler.js:79:16

   - Compiler.js:306 
      [action-center-ui]/[webpack]/lib/Compiler.js:306:11

   - Compiler.js:631 
      [action-center-ui]/[webpack]/lib/Compiler.js:631:15


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
   [action-center-ui]/[tapable]/lib/Hook.js:154:20

   - Compiler.js:628
   [action-center-ui]/[webpack]/lib/Compiler.js:628:31


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
    [action-center-ui]/[tapable]/lib/Hook.js:154:20

  - Compilation.js:1325
   [action-center-ui]/[webpack]/lib/Compilation.js:1325:35


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
   [action-center-ui]/[tapable]/lib/Hook.js:154:20

 - Compilation.js:1316
    [action-center-ui]/[webpack]/lib/Compilation.js:1316:32


  - Hook.js:154 AsyncSeriesHook.lazyCompileHook
    [action-center-ui]/[tapable]/lib/Hook.js:154:20

   - Compilation.js:1311
     [action-center-ui]/[webpack]/lib/Compilation.js:1311:36

   ERROR in chunk styles-jpmol [entry]
      Cannot read property 'sort' of undefined
       Child html-webpack-plugin for "jpmol-error.html":
      1 asset
         Entrypoint undefined = jpmol-error.html
        [./node_modules/html-webpack-plugin/lib/loader.js!./src/app/jpmol- 
        error.ejs] 844 bytes {0} [built]
        [./node_modules/lodash/lodash.js] 527 KiB {0} [built]
        [./node_modules/webpack/buildin/global.js] 
       (webpack)/buildin/global.js 472 bytes {0} [built]
        [./node_modules/webpack/buildin/module.js] 
        (webpack)/buildin/module.js 497 bytes {0} [built


   ERROR in chunk 0 [entry]
    Cannot read property 'sort' of undefined
  Child html-webpack-plugin for "capture.html":
     1 asset
    Entrypoint undefined = capture.html
     [./node_modules/html-webpack- 
   plugin/lib/loader.js!./src/app/capture.ejs] 840 bytes {0} [built]
     [./node_modules/lodash/lodash.js] 527 KiB {0} [built]
     [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 
     472 bytes {0} [built]
     [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 
    497 bytes {0} [built]

     ERROR in chunk 0 [entry]
     Cannot read property 'sort' of undefined

Я обновил все плагины веб-пакетачтобы соответствовать версии 4, но не смог преодолеть эту ошибку.

...