index.mpx
只要添加上這句話(huà)? ? ?import store from '../store/index.js'
就報(bào)錯(cuò) :
Hash: 2a69cb49eb697feb2623
Version: webpack 4.46.0
Time: 472ms
Built at: 01/19/2021 3:25:52 PM
? ? ? ? ? ? ?Asset? ? ? Size? Chunks? ? ? ? ? ? ? ? ? ? ? ? ? Chunk Names
? ? ? ? ? ? app.js? 56.6 KiB? ? ? ?0? [emitted]? ? ? ? ? ? ? ?app
? ? ? ? app.js.map? 57.4 KiB? ? ? ?0? [emitted] [dev]? ? ? ? ?app
? ? ? ? ? app.json? 38 bytes? ? ? ? ? [emitted]? ? ? ? ? ? ? ?
? ? ? ? ?bundle.js? ?520 KiB? ? ? ?1? [emitted]? ? ? ? [big]? bundle
? ? ?bundle.js.map? ?576 KiB? ? ? ?1? [emitted] [dev]? ? ? ? ?bundle
? ? pages/index.js? 2.39 KiB? ? ? ?2? [emitted]? ? ? ? ? ? ? ?pages/index
pages/index.js.map? 2.66 KiB? ? ? ?2? [emitted] [dev]? ? ? ? ?pages/index
? pages/index.json? 27 bytes? ? ? ? ? [emitted]? ? ? ? ? ? ? ?
? pages/index.wxml? 63 bytes? ? ? ? ? [emitted]? ? ? ? ? ? ? ?
ERROR in ./src/pages/index.mpx?isFirst=true
Module Error (from ./node_modules/eslint-loader/index.js):
/Users/zhangwei/Desktop/小程序/mpx-demo/src/pages/index.mpx
? 8:10? error? 'store' is defined but never used? no-unused-vars
? 1 problem (1 error, 0 warnings)
ERROR in ./src/store/index.js
Module Error (from ./node_modules/eslint-loader/index.js):
/Users/zhangwei/Desktop/小程序/mpx-demo/src/store/index.js
? 1:8? ?error? A space is required after '{'? ?object-curly-spacing
? 1:20? error? A space is required before '}'? object-curly-spacing
? 2 problems (2 errors, 0 warnings)
? 2 errors and 0 warnings potentially fixable with the `--fix` option.
?@ ./src/pages/index.mpx?isFirst=true (./node_modules/babel-loader/lib!./node_modules/@mpxjs/webpack-plugin/lib/selector.js?{"type":"script","index":0}!./src/pages/index.mpx?isFirst=true) 2:0-38
?@ ./src/pages/index.mpx?isFirst=true
? Build failed with errors.
但是小程序那邊可以運(yùn)行
2021-03-17
你好,這些報(bào)錯(cuò)都是eslint報(bào)的,不符合eslint規(guī)則,第一個(gè)是說(shuō)你引入的store沒(méi)有使用,第二個(gè)就是說(shuō)你應(yīng)該在左大括號(hào)后和右大括號(hào)前各留一下空格。