yarn start一直卡在roadhog server不动
tdida opened this issue · comments
roadhog: 2.2.0
yarn start一直卡在roadhog server不动
这么提问没法帮你定位问题。。
-
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"] }
@sorrycc clonse https://github.com/ant-design/ant-design-pro.git 下来roadhog server运行也是报这个错误,好像是昨天roadhog 2.3.0发布后出现的
新 clone 了 ant-design-pro,没发现问题。
遇到了同样的问题,2.2.0 => 2.3.0 后出现的
无任何报错,只是卡住不动,降回2.2.0后恢复正常
@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
同遇到,情况一样。
有点区别的是,同一套代码,在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 配错了吧。