首页 > 解决方案 > 运行下一个构建时出错

问题描述

当我运行 npm next build 时,我收到此错误。我试过用谷歌搜索,但找不到解决方案,我还尝试安装“extract-text-webpack-plugin”

那不解决问题。。

这是它抛出的错误:

> next build

(node:8136) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[11:17:18] Compiling client
[11:17:18] Compiling server
(node:8136) UnhandledPromiseRejectionWarning: Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\Chunk.js:824:9)
    at C:\Users\char\Documents\GitHub\Si.Client\node_modules\@zeit\next-css\node_modules\extract-text-webpack-plugin\dist\index.js:176:48
    at Array.forEach (<anonymous>)
    at C:\Users\char\Documents\GitHub\Si.Client\node_modules\@zeit\next-css\node_modules\extract-text-webpack-plugin\dist\index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\char\Documents\GitHub\Si.Client\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (C:\Users\char\Documents\GitHub\Si.Client\node_modules\tapable\lib\Hook.js:35:21)
    at Compilation.seal (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\Compilation.js:1203:27)
    at hooks.make.callAsync.err (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\Compiler.js:547:17)
    at _err0 (eval at create (C:\Users\char\Documents\GitHub\Si.Client\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:11:1)
    at Promise.all.then (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\DynamicEntryPlugin.js:73:20)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:8136) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with
.catch(). (rejection id: 1)
(node:8136) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8136) UnhandledPromiseRejectionWarning: Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\Chunk.js:824:9)
    at C:\Users\char\Documents\GitHub\Si.Client\node_modules\@zeit\next-css\node_modules\extract-text-webpack-plugin\dist\index.js:176:48
    at Array.forEach (<anonymous>)
    at C:\Users\char\Documents\GitHub\Si.Client\node_modules\@zeit\next-css\node_modules\extract-text-webpack-plugin\dist\index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\char\Documents\GitHub\Si.Client\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (C:\Users\char\Documents\GitHub\Si.Client\node_modules\tapable\lib\Hook.js:35:21)
    at Compilation.seal (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\Compilation.js:1203:27)
    at hooks.make.callAsync.err (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\Compiler.js:547:17)
    at _err0 (eval at create (C:\Users\char\Documents\GitHub\Si.Client\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:11:1)
    at Promise.all.then (C:\Users\char\Documents\GitHub\Si.Client\node_modules\webpack\lib\DynamicEntryPlugin.js:73:20)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:8136) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with
.catch(). (rejection id: 2)

真的很感谢解答!

标签: javascriptreactjsnpmnode-modulesnext.js

解决方案


这个插件需要更新。更新一切顺利后我遇到了同样的问题:)

npm install extract-text-webpack-plugin@next
yarn add extract-text-webpack-plugin@next

推荐阅读