SyntaxError when builded, can't understand why
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, react, webpack
- 领域
- build-system, frontend
调研方向
从 webpack.config.js 以及失败的入口点 client/pages/Home/index.js 和 client/index.js 开始,然后运行 npm start 以重现解析器错误。当两个文件中的 JSX 均成功编译,并且 webpack 报告构建成功时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
cloning your react-dynamic-route-loading-es6
when trying npm start
have ERROR in ./client/pages/Home/index.js
Module build failed: SyntaxError: Unexpected token (13:2)
11 |
12 | export default () => (
> 13 | <article className="home">
| ^
14 | <Header title="Home" className="header-dark" />
15 | <List columns={2} items={twoColListItems} />
16 | </article>
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server index pages/Home
full console
`[vasil@localhost webpack_split]$ sudo npm start
> [email protected] start /home/vasil/workplace/webpack_split
> webpack-dev-server --config webpack.config.js
Project is running at http://localhost:3000/
webpack output is served from /
Content not from webpack is served from ./client
404s will fallback to /index.html
(node:11765) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Hash: d36e34181bf36fbc7888
Version: webpack 2.2.0
Time: 2610ms
Asset Size Chunks Chunk Names
bundle.js 2.23 kB 0 [emitted] js
vendor.bundle.js 1.02 MB 1 [emitted] [big] vendor
bundle.js.map 102 bytes 0 [emitted] js
vendor.bundle.js.map 1.2 MB 1 [emitted] vendor
index.html 429 bytes [emitted]
chunk {0} bundle.js, bundle.js.map (js) 1.75 kB {1} [initial] [rendered]
[./index.js] ./client/index.js 595 bytes {0} [built] [failed] [1 error]
[./pages/Home/index.js] ./client/pages/Home/index.js 1.09 kB {0} [built] [failed] [1 error]
[0] multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server index pages/Home 64 bytes {0} [built]
chunk {1} vendor.bundle.js, vendor.bundle.js.map (vendor) 936 kB [entry] [rendered]
[../node_modules/ansi-regex/index.js] ./~/ansi-regex/index.js 135 bytes {1} [built]
[../node_modules/fbjs/lib/ExecutionEnvironment.js] ./~/fbjs/lib/ExecutionEnvironment.js 1.06 kB {1} [built]
[../node_modules/react-dom/index.js] ./~/react-dom/index.js 59 bytes {1} [built]
[../node_modules/react-dom/lib/ReactDOM.js] ./~/react-dom/lib/ReactDOM.js 5.14 kB {1} [built]
[../node_modules/react/lib/React.js] ./~/react/lib/React.js 2.69 kB {1} [built]
[../node_modules/react/lib/ReactPropTypes.js] ./~/react/lib/ReactPropTypes.js 15.8 kB {1} [built]
[../node_modules/react/react.js] ./~/react/react.js 56 bytes {1} [built]
[../node_modules/strip-ansi/index.js] ./~/strip-ansi/index.js 161 bytes {1} [built]
[1] multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server react react-dom 64 bytes {1} [built]
[../node_modules/url/url.js] ./~/url/url.js 23.3 kB {1} [built]
[../node_modules/webpack-dev-server/client/index.js?http:/localhost:3000] (webpack)-dev-server/client?http://localhost:3000 4.66 kB {1} [built]
[../node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 856 bytes {1} [built]
[../node_modules/webpack/hot/dev-server.js] (webpack)/hot/dev-server.js 1.57 kB {1} [built]
[../node_modules/webpack/hot/emitter.js] (webpack)/hot/emitter.js 77 bytes {1} [built]
[../node_modules/webpack/hot/log-apply-result.js] (webpack)/hot/log-apply-result.js 1.02 kB {1} [built]
+ 241 hidden modules
ERROR in ./client/pages/Home/index.js
Module build failed: SyntaxError: Unexpected token (13:2)
11 |
12 | export default () => (
> 13 | <article className="home">
| ^
14 | <Header title="Home" className="header-dark" />
15 | <List columns={2} items={twoColListItems} />
16 | </article>
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server index pages/Home
ERROR in ./client/index.js
Module build failed: SyntaxError: Unexpected token (8:2)
6 |
7 | render(
> 8 | <Root />,
| ^
9 | document.getElementById('root')
10 | );
11 |
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server index pages/Home
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 568 kB 0
chunk {0} index.html 541 kB [entry] [rendered]
[../node_modules/html-webpack-plugin/lib/loader.js!./index.ejs] ./~/html-webpack-plugin/lib/loader.js!./client/index.ejs 675 bytes {0} [built]
[../node_modules/lodash/lodash.js] ./~/lodash/lodash.js 540 kB {0} [built]
[../node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {0} [built]
[../node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 517 bytes {0} [built]
webpack: Failed to compile.
`
- 主要语言
- JavaScript
- 星标
- 294
- 派生
- 64
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ModusCreateOrg/react-dynamic-route-loading-es6 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 25/100
ModusCreateOrg/react-dynamic-route-loading-es6#21 · 1 条评论 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 25/100
ModusCreateOrg/react-dynamic-route-loading-es6#4 · 2 条评论 ·
查看 ModusCreateOrg/react-dynamic-route-loading-es6 的全部 Issue
相似的 Issue
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
stac-utils/stac-fields#42 ·
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
channels:add check:passed
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 2 天内回复