webpack打包错误ERROR in ./src/page/index/index.css

Hash: 7a7713dc8f12d5fa37fa

Version: webpack 1.15.0

Time: 108ms

      Asset       Size  Chunks             Chunk Names

 js/base.js    4.37 kB       0  [emitted]  common

js/index.js  560 bytes       1  [emitted]  index

js/login.js  426 bytes       2  [emitted]  login

   [0] multi common 28 bytes {0} [built]

   [0] multi index 28 bytes {1} [built]

   [0] multi login 28 bytes {2} [built]

   [1] ./src/page/common/index.js 170 bytes {0} [built]

   [2] ./src/page/index/index.js 192 bytes {1} [built] [1 error]

   [3] ./src/page/index/index.css 0 bytes [built] [failed]

   [4] ./src/page/module.js 179 bytes {0} [built]

   [5] ./src/page/login/index.js 196 bytes {2} [built]


ERROR in ./src/page/index/index.css

Module parse failed: C:\Users\wh\Desktop\mmall\doc\mmall-fe\src\page\index\index.css Unexpected token (8:4)

You may need an appropriate loader to handle this file type.

SyntaxError: Unexpected token (8:4)

    at Parser.pp$4.raise (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:2221:15)

    at Parser.pp.unexpected (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:603:10)

    at Parser.pp.semicolon (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:581:61)

    at Parser.pp$1.parseExpressionStatement (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:966:10)

    at Parser.pp$1.parseStatement (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:730:24)

    at Parser.pp$1.parseTopLevel (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:638:25)

    at Parser.parse (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:516:17)

    at Object.parse (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\acorn\dist\acorn.js:3098:39)

    at Parser.parse (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack\lib\Parser.js:902:15)

    at NormalModule.<anonymous> (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack\lib\NormalModule.js:104:16)

    at NormalModule.onModuleBuild (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack-core\lib\NormalModuleMixin.js:310:10)

    at nextLoader (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack-core\lib\NormalModuleMixin.js:275:25)

    at C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\webpack-core\lib\NormalModuleMixin.js:259:5

    at Storage.finished (C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:38:16)

    at C:\Users\wh\Desktop\mmall\doc\mmall-fe\node_modules\graceful-fs\graceful-fs.js:90:16

    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

 @ ./src/page/index/index.js 9:0-22

按老师视频中进行操作,但是打包报错

慕粉3422128
浏览 4049回答 2
2回答

脚扶拖拉机

版本问题,老师视频中在查看是否安装成功的时候能看到两个loader的版本,重新安装的时候指定为老师的版本即可

pardon110

css相关的loader配置错误
打开App,查看更多内容
随时随地看视频慕课网APP