background: url() no-repeat在括号里引入../../image/icon/loading.gif就报错,图片路径已设制

来源:4-6 通用UI布局,样式开发

慕九州0507976

2018-09-20

在控制台中:
base.js?e6ba91a29c7f55c60f64:7839 Uncaught Error: Cannot find module "…/…/image/icon/loading.gif"
at webpackMissingModule (base.js?e6ba91a29c7f55c60f64:7839)
at Object.module.exports (base.js?e6ba91a29c7f55c60f64:7839)
at webpack_require (base.js?e6ba91a29c7f55c60f64:53)
at Object. (base.js?e6ba91a29c7f55c60f64:7806)
at webpack_require (base.js?e6ba91a29c7f55c60f64:53)
at Object. (base.js?e6ba91a29c7f55c60f64:7797)
at webpack_require (base.js?e6ba91a29c7f55c60f64:53)
at Object. (base.js?e6ba91a29c7f55c60f64:104)
at webpack_require (base.js?e6ba91a29c7f55c60f64:53)
at base.js?e6ba91a29c7f55c60f64:96
webpackMissingModule @ base.js?e6ba91a29c7f55c60f64:7839
module.exports @ base.js?e6ba91a29c7f55c60f64:7839
webpack_require @ base.js?e6ba91a29c7f55c60f64:53
(anonymous) @ base.js?e6ba91a29c7f55c60f64:7806
webpack_require @ base.js?e6ba91a29c7f55c60f64:53
(anonymous) @ base.js?e6ba91a29c7f55c60f64:7797
webpack_require @ base.js?e6ba91a29c7f55c60f64:53
(anonymous) @ base.js?e6ba91a29c7f55c60f64:104
webpack_require @ base.js?e6ba91a29c7f55c60f64:53
(anonymous) @ base.js?e6ba91a29c7f55c60f64:96
(anonymous) @ base.js?e6ba91a29c7f55c60f64:99
index.js?e6ba91a29c7f55c60f64:38

457

base.js?e6ba91a29c7f55c60f64:8388 [WDS] Errors while compiling.
base.js?e6ba91a29c7f55c60f64:8426 ./src/image/icon/loading.gif
Module build failed: Error: ENOENT: no such file or directory, open '/Users/bxz/bxz/doc/bxz-fe/src/image/icon/loading.gif’
at Error (native)
@ ./~/css-loader!./src/page/common/layout.css 6:1292-1331
errors @ base.js?e6ba91a29c7f55c60f64:8426
sock.onmessage @ base.js?e6ba91a29c7f55c60f64:1649
EventTarget.dispatchEvent @ base.js?e6ba91a29c7f55c60f64:3447
(anonymous) @ base.js?e6ba91a29c7f55c60f64:6552
SockJS._transportMessage @ base.js?e6ba91a29c7f55c60f64:6550
EventEmitter.emit @ base.js?e6ba91a29c7f55c60f64:3383
WebSocketTransport.ws.onmessage @ base.js?e6ba91a29c7f55c60f64:1735
base.js?e6ba91a29c7f55c60f64:8426 ./src/page/common/layout.css
Module build failed: ModuleBuildError: Module build failed: Error: ENOENT: no such file or directory, open '/Users/bxz/bxz/doc/bxz-fe/src/image/icon/loading.gif’
at Error (native)
at DependenciesBlock.onModuleBuildFailed (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19)
at nextLoader (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31)
at /Users/bxz/bxz/doc/bxz-fe/node_modules/webpack-core/lib/NormalModuleMixin.js:256:20
at Storage.provide (/Users/bxz/bxz/doc/bxz-fe/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:52:20)
at CachedInputFileSystem.readFile (/Users/bxz/bxz/doc/bxz-fe/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:140:24)
at DependenciesBlock.onLoadPitchDone (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack-core/lib/NormalModuleMixin.js:255:7)
at DependenciesBlock.loadPitch (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack-core/lib/NormalModuleMixin.js:182:27)
at DependenciesBlock.doBuild (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack-core/lib/NormalModuleMixin.js:241:4)
at DependenciesBlock.build (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack/lib/NormalModule.js:84:14)
at Compilation.buildModule (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack/lib/Compilation.js:126:9)
at /Users/bxz/bxz/doc/bxz-fe/node_modules/webpack/lib/Compilation.js:309:10
at /Users/bxz/bxz/doc/bxz-fe/node_modules/webpack/lib/NormalModuleFactory.js:58:13
at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/bxz/bxz/doc/bxz-fe/node_modules/tapable/lib/Tapable.js:75:69)
at onDoneResolving (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack/lib/NormalModuleFactory.js:38:11)
at onDoneResolving (/Users/bxz/bxz/doc/bxz-fe/node_modules/webpack/lib/NormalModuleFactory.js:121:6)
at /Users/bxz/bxz/doc/bxz-fe/node_modules/webpack/lib/NormalModuleFactory.js:116:7

写回答

1回答

慕九州0507976

提问者

2018-09-20

这是不是和webpack打包生成css有关,路径受到影响

0
1
Rosen
从报错上看,应该是图片路径找的不对
2018-09-21
共1条回复

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

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

4262 学习 · 4113 问题

查看课程