sorrycc / roadhog

🐷 Cli tool for creating react apps, configurable version of create-react-app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yarn start一直卡在roadhog server不动

tdida opened this issue · comments

commented

roadhog: 2.2.0

yarn start一直卡在roadhog server不动

这么提问没法帮你定位问题。。

commented
  • yarn start运行项目,项目一直卡在roadhog server不动

  • 直接roadhog server运行项目,提示这个

Syntax error: Decorators are not officially supported yet in 6.x pending a proposal update.
However, if you need to use them you can install the legacy decorators transform with:

npm install babel-plugin-transform-decorators-legacy --save-dev

and add the following line to your .babelrc file:

{
"plugins": ["transform-decorators-legacy"]
}

The repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.

  • 可我有配置transform-decorators-legacy

.webpackrc.js文件

export default { entry: 'src/index.js', extraBabelPlugins: [ 'transform-decorators-legacy', ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }], ], env: { development: { extraBabelPlugins: ['dva-hmr'], }, }, ignoreMomentLocale: true, theme: './src/theme.js', html: { template: './src/index.ejs', }, hash: true, proxy: { '/api': { target: 'http://192.168.191.161:7001', changeOrigin: true, pathRewrite: { '^/': '' }, }, }, publicPath: '/', disableDynamicImport: true, };

package.json文件

{ "private": true, "scripts": { "start": "roadhog server", "build": "roadhog build", "lint": "eslint --ext .js src test", "precommit": "npm run lint" }, "dependencies": { "@antv/data-set": "^0.8.5", "@babel/polyfill": "^7.0.0-beta.40", "antd": "^3.3.0", "axios": "^0.18.0", "babel-runtime": "^6.26.0", "bizcharts": "^3.1.4-beta.3", "bizcharts-plugin-slider": "^2.0.1", "classnames": "^2.2.5", "dva": "^2.1.0", "dva-loading": "^1.0.4", "enquire-js": "^0.1.2", "lodash": "^4.17.5", "lodash-decorators": "^4.5.0", "moment": "^2.21.0", "numeral": "^2.0.6", "omit.js": "^1.0.0", "path-to-regexp": "^2.2.0", "prop-types": "^15.6.1", "qs": "^6.5.1", "react": "^16.2.0", "react-container-query": "^0.11.0", "react-document-title": "^2.0.3", "react-dom": "^16.2.0", "react-fittext": "^1.0.0", "react-lz-editor": "^0.11.9", "url-polyfill": "^1.0.11" }, "devDependencies": { "babel-eslint": "^8.2.2", "babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-import": "^1.6.5", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-runtime": "^6.9.0", "eslint": "^4.18.1", "eslint-config-airbnb": "^16.1.0", "eslint-plugin-compat": "^2.2.0", "eslint-plugin-html": "^4.0.2", "eslint-plugin-import": "^2.9.0", "eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-react": "^7.7.0", "expect": "^22.4.0", "husky": "^0.14.3", "redbox-react": "^1.5.0", "roadhog": "^2.2.0" }, "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"] }

commented

@sorrycc clonse https://github.com/ant-design/ant-design-pro.git 下来roadhog server运行也是报这个错误,好像是昨天roadhog 2.3.0发布后出现的

新 clone 了 ant-design-pro,没发现问题。

commented

@sorrycc 执行roadhog server,node进程就cpu占用100%,项目一直启动不起来

commented

@sorrycc roadhog build也是卡住,node进程cpu占用爆掉

遇到了同样的问题,2.2.0 => 2.3.0 后出现的

无任何报错,只是卡住不动,降回2.2.0后恢复正常

commented

@canisminor1990 我降回2.2.0也不行

@canisminor1990 提个可重现的项目上来?

mac 10.13.2
node 8.10.0
roadhog 2.3.0

执行roadhog dev,CPU卡死,ctrl+c强制关闭roadhog,node进程无法杀死,CPU占用99.9%

降级为2.2.0,正常启动

尝试了不同node版本,都有这个问题,另外mac 10.13.3+roadhog 2.3.0正常

请告知roadhog如何加启动调试参数,类似npm install -dd这样,可以打印debug日志

@shengbeiniao 老哥,你解决了吗?我这边也是同样的问题。ant-design-pro,能够正常起来。
mac 10.13.3
node 8.5.0 、9.1.0
roadhog 2.3.0
降级为2.2.0,正常启动,但是报了很多错。

@varrant 降级2.2正常,要改下启动参数package.json DISABLE_ESLINT=none

@varrant 同样的问题 请问怎么降会2.2

mac 10.12.1
node v9.6.1
roadhog 2.3.0

同样遇到执行 cnpm start 时

一直卡在 > cross-env ESLINT=none roadhog dev 不动,同时 Cpu 占用 100%以上。

我感觉就是roadhog处理太慢

解决方法:把其它高占Cpu 的进程全部关掉,等待一会儿,就启动成功。

image

同遇到,情况一样。

有点区别的是,同一套代码,在docker容器下跑就出现CPU 100,在宿主机上就没事。

降回2.2.0 OK

使用 dtruss 观察后发现这个进程在遍历很多非当前 node 项目的文件,在某个地方死循环了,降级到 2.2.0 正常了。感觉是 eslint 或者某个处理路径的地方有问题了

So the current solution can only reduce the version?

Try to upgrade roadhog to 2.4, then run:

$ TS_CONFIG_PATHS_PLUGIN=none roadhog dev
$ TS_CONFIG_PATHS_PLUGIN=none roadhog build

设置 TS_CONFIG_PATHS_PLUGIN=none 后解决

@sorrycc 是关闭 typescript 的插件?

两小时前还正常 现在又有问题 报错Unexpected token + in JSON at position 2

@zl810881283 哪里有 JSON 配错了吧。