Closed songyazhao closed 6 years ago
dev下,热重启多几次就会js heap out of memory,作者赶紧解决下吧,开发时得不停的手动杀进程重启
这个估计是 ts-loader 有关,你这个项目构建的文件很大?
遇到同样的问题,项目属于多页面后台系统
这个是日志
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\luogan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm@6.0.0
3 info using node@v8.11.1
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle demo@1.0.0~predev: demo@1.0.0
6 info lifecycle demo@1.0.0~dev: demo@1.0.0
7 verbose lifecycle demo@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle demo@1.0.0~dev: PATH: C:\Users\luogan\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\aishangCode\Supplier\Store\node_modules.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\TortoiseSVN\bin;D:\installAll\Git\cmd;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;C:\Users\luogan\AppData\Roaming\npm;C:\Users\luogan\AppData\Local\Yarn\bin;C:\Program Files\Java\jdk1.8.0_131\bin;C:\Program Files\Java\jdk1.8.0_131\jre\bin
9 verbose lifecycle demo@1.0.0~dev: CWD: D:\aishangCode\Supplier\Store
10 silly lifecycle demo@1.0.0~dev: Args: [ '/d /s /c',
10 silly lifecycle 'webpack-dev-server --inline --progress --config build/webpack.dev.conf.js' ]
11 silly lifecycle demo@1.0.0~dev: Returned: code: 3 signal: null
12 info lifecycle demo@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: demo@1.0.0 dev: webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
13 verbose stack Exit status 3
13 verbose stack at EventEmitter.webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
22 error Exit status 3
23 error Failed at the demo@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3, true ]
{ "scripts": { "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js" }, "dependencies": { "axios": "^0.18.0", "iviewxx": "^1.7.3", "node-sass": "^4.8.3", "qs": "^6.5.1", "sass-loader": "^7.0.1", "vue": "^2.5.2", "vue-awesome-swiper": "^3.1.3", "vue-router": "^3.0.1", "vuex": "^3.0.1" }, "devDependencies": { "autoprefixer": "^7.1.2", "babel-core": "^6.22.1", "babel-eslint": "^8.2.1", "babel-helper-vue-jsx-merge-props": "^2.0.3", "babel-loader": "^7.1.1", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-runtime": "^6.22.0", "babel-plugin-transform-vue-jsx": "^3.5.0", "babel-preset-env": "^1.3.2", "babel-preset-stage-2": "^6.22.0", "chalk": "^2.0.1", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.0", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", "eslint-loader": "^1.7.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-node": "^5.2.0", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^3.0.1", "eslint-plugin-vue": "^4.5.0", "extract-text-webpack-plugin": "^3.0.0", "file-loader": "^1.1.4", "friendly-errors-webpack-plugin": "^1.6.1", "html-webpack-plugin": "^2.30.1", "iview": "^2.13.1", "node-notifier": "^5.1.2", "optimize-css-assets-webpack-plugin": "^3.2.0", "ora": "^1.2.0", "portfinder": "^1.0.13", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.8", "postcss-url": "^7.2.1", "rimraf": "^2.6.0", "semver": "^5.3.0", "shelljs": "^0.7.6", "uglifyjs-webpack-plugin": "^1.1.1", "url-loader": "^0.5.8", "vue-loader": "^13.3.0", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.5.2", "webpack": "^3.6.0", "webpack-bundle-analyzer": "^2.9.0", "webpack-dev-server": "^2.9.1", "webpack-merge": "^4.1.0" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" }, "browserslist": [ "> 1%", "last 2 versions", "not ie <= 8" ] }
@hubcarl 不是因为 ts-loader
,前端没有使用 ts
,整个项目架构是基于 egg-vue-typescript-boilerplate ,然后把项目的前端部分替换成了js实现 现在项目也不是很大,十来个页面的样子。目前看来是和前端的热更新有关,后端的代码怎么改也是没事的。
@songyazhao 你在看看, easywebpack4 最近修复了一个问题:https://github.com/hubcarl/easywebpack/compare/4.5.0...4.5.1 怀疑与这个有关
Webpack4 有反馈这个问题,目前需要查,Webpack3 暂没有人反馈
在window 10 下,经常会碰到这个问题
已使用内存超过10G就会自动重启
初步验证已修复,先关闭,如还有问题,再跟进!
还有内存溢出问题
前端vue的东西修改发生热更新,过一段时间之后报错如下。 看网上的方案是在dev的时候加上
node --max_old_space_size=4096
。 但是只能延缓出现这个错误的时间。 暂时的解决方法就是重启dev。 感觉很繁琐,有没有更好的办法解决一下。 看了vue-cli生成的项目不会出现这个问题,所以是否可以借鉴下它的内部是如何运作热更新释放内存中的资源。package.json