Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

> webpack --config webpack-handle-css.js --progress --color

  0% compiling(node:9447) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
 77% module and chunk tree optimization unnamed compat plugin/Users/lx/workspace/front-web/node_modules/webpack/lib/Chunk.js:741
		throw new Error(
		^

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (/Users/lx/workspace/front-web/node_modules/webpack/lib/Chunk.js:741:9)
    at /Users/lx/workspace/front-web/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
    at Array.forEach (<anonymous>)
    at /Users/lx/workspace/front-web/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/lx/workspace/front-web/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/lx/workspace/front-web/node_modules/tapable/lib/Hook.js:35:21)
    at Compilation.seal (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compilation.js:904:27)
    at hooks.make.callAsync.err (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compiler.js:494:17)
    at _done (eval at create (/Users/lx/workspace/front-web/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:9:1)
    at _err1 (eval at create (/Users/lx/workspace/front-web/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:32:22)
    at _addModuleChain (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compilation.js:770:12)
    at processModuleDependencies.err (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compilation.js:709:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mouth-platform-web-h5@1.0.0 css:build: `webpack --config webpack-handle-css.js --progress --color`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mouth-platform-web-h5@1.0.0 css:build 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/lx/.npm/_logs/2018-06-01T08_12_30_315Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mouth-platform-web-h5@1.0.0 css: `npm run css:build && npm run css:clean`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mouth-platform-web-h5@1.0.0 css 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/lx/.npm/_logs/2018-06-01T08_12_30_357Z-debug.log

分析问题

官网解答

Yep extract-text-webpack-plugin isn't updated for webpack >= v4.0.0 yet and is completely broken since webpack@4.0.0-alpha.5. It may be superseded by another plugin/solution or will get an update before the final webpack v4.0.0 release

出现这个问题了,那基本上你用的webpack版本一定是4.0.0以上的了。

解决方法

npm install --save-dev extract-text-webpack-plugin@next

lxdeMacBook-Air:front-web lx$ npm install --save-dev extract-text-webpack-plugin@next
npm WARN react-native-collapsible@0.9.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout@1.3.2 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-redux@5.0.7 requires a peer of redux@^2.0.0 || ^3.0.0 || ^4.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN uglifyjs-webpack-plugin@1.1.6 requires a peer of webpack@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@1.12.0 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN mouth-platform-web-h5@1.0.0 No repository field.

+ extract-text-webpack-plugin@4.0.0-beta.0
removed 3 packages and updated 1 package in 11.617s

已经下载到 + extract-text-webpack-plugin@4.0.0-beta.0

然后在打包就正常了

转载于:https://my.oschina.net/johnsken/blog/1822660

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当出现"Uncaught SyntaxError: Unexpected token '<'"错误时,这通常是由于在代码中出现了不正确的语法或格式问题导致的。这个错误表明在代码的第35行的35.chunk.worker.js文件中出现了一个意外的"<"符号。 为了解决这个问题,可以尝试以下几个方法: 1. 查看35.chunk.worker.js文件的第35行,检查是否有语法错误或意外的字符。确保代码的语法正确,并且没有缺少或多余的字符。 2. 检查所使用的JavaScript版本是否与代码兼容。某些旧版的JavaScript可能无法识别一些新的语法或标记,导致出现此错误。如果是这种情况,可以尝试使用较新或较旧的JavaScript版本来解决问题。 3. 如果代码中引入了其他文件或库,确保这些文件或库的路径和引入方式都是正确的。如果路径或引入方式错误,可能会导致解析错误,进而引发这个错误。 4. 如果代码中使用了jQuery,建议尝试使用较旧版本的jQuery,例如1.8.2min版本,因为某些版本的jQuery在首次引入时可能会出现问题。 综上所述,当出现"Uncaught SyntaxError: Unexpected token '<'"错误时,可以通过检查代码的语法、版本兼容性以及文件引入方式来解决问题。如果问题仍然存在,可以进一步检查其他相关的代码文件和错误提示信息,以便更好地定位和解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值