TypeError: element.loader.split is not a function

来源:3-5 webpack对脚本和样式的处理

慕仰6407547

2019-03-14

ExtractTextPlugin.extract(“style-loader”,“css-loader”) 这个加完了之后webpack报错
$ webpack
E:\doc\mmall-fe\node_modules\webpack-core\lib\LoadersList.js:58
if(element.loader) return element.loader.split("!");
^

TypeError: element.loader.split is not a function
at getLoadersFromObject (E:\doc\mmall-fe\node_modules\webpack-core\lib\LoadersList.js:58:43)
at LoadersList. (E:\doc\mmall-fe\node_modules\webpack-core\lib\LoadersList.js:78:12)
at Array.map ()
at LoadersList.match (E:\doc\mmall-fe\node_modules\webpack-core\lib\LoadersList.js:70:19)
at E:\doc\mmall-fe\node_modules\webpack\lib\NormalModuleFactory.js:111:68
at E:\doc\mmall-fe\node_modules\async\lib\async.js:726:13
at E:\doc\mmall-fe\node_modules\async\lib\async.js:52:16
at done (E:\doc\mmall-fe\node_modules\async\lib\async.js:246:17)
at E:\doc\mmall-fe\node_modules\async\lib\async.js:44:16
at E:\doc\mmall-fe\node_modules\async\lib\async.js:723:17
at E:\doc\mmall-fe\node_modules\async\lib\async.js:167:37
at E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:29:4
at onResolved (E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\Resolver.js:39:10)
at E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\Resolver.js:123:21
at E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\Resolver.js:191:15
at applyPluginsParallelBailResult.createInnerCallback.log (E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\Resolver.js:104:30)
at loggingCallbackWrapper (E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\createInnerCallback.js:21:19)
at E:\doc\mmall-fe\node_modules\tapable\lib\Tapable.js:134:6
at innerCallback (E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\Resolver.js:90:37)
at loggingCallbackWrapper (E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\createInnerCallback.js:21:19)
at E:\doc\mmall-fe\node_modules\tapable\lib\Tapable.js:134:6
at Resolver. (E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\ResultSymlinkPlugin.js:39:32)
at E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\Resolver.js:191:15
at E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\ResultSymlinkPlugin.js:36:5
at Storage.finished (E:\doc\mmall-fe\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:38:16)
at FSReqCallback.args [as oncomplete] (fs.js:145:20)

写回答

1回答

慕仰6407547

提问者

2019-03-14

已解决,原来是ExtractTextPlugin版本太高了

0
1
Rosen
收到!
2019-03-15
共1条回复

真实数据对接 从0开发前后端分离的企业级上线项目

【毕设项目精品】前端实战,对接真实服务端数据,开发完整项目

4262 学习 · 4113 问题

查看课程