自从更新为CRA 2.0以来,我的Yarn版本已损坏。
出现内存不足错误,我尝试以更大的最大内存运行,但这没有任何区别。
纱线开始很好,但是纱线成型会出现以下错误:
<--- Last few GCs --->
[14692:000001A168B8CC30] 367561 ms: Mark-sweep 1245.1 (1430.7) -> 1244.8 (1433.2) MB, 4524.1 / 0.0 ms allocation failure GC in old space requested
[14692:000001A168B8CC30] 372188 ms: Mark-sweep 1244.8 (1433.2) -> 1244.8 (1387.7) MB, 4626.6 / 0.0 ms last resort GC in old space requested
[14692:000001A168B8CC30] 377070 ms: Mark-sweep 1244.8 (1387.7) -> 1244.8 (1378.2) MB, 4882.6 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 00000117FCAA57C1 <JSObject>
0: builtin exit frame: stringify(this=00000117FCA88FF1 <Object map = 0000015BE0D02BA1>,000002A6D8C022D1 <undefined>,000002A6D8C022D1 <undefined>,00000025F91DAB39 <Object map = 0000016E6AF79681>)
1: arguments adaptor frame: 1->3
2: _send [internal/child_process.js:675] [bytecode=0000024FC7AFB9B1 offset=551](this=0000037EBD602981 <process map = 0000015BE0D0A341>,message=00000025F91D...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node_module_register
2: v8::internal::FatalProcessOutOfMemory
3: v8::internal::FatalProcessOutOfMemory
4: v8::internal::Factory::NewRawTwoByteString
5: v8::internal::Smi::SmiPrint
6: v8::internal::StackGuard::HandleInterrupts
7: v8::internal::wasm::LocalDeclEncoder::Size
8: v8::internal::wasm::LocalDeclEncoder::Size
9: v8::internal::wasm::LocalDeclEncoder::Size
10: v8::internal::wasm::LocalDeclEncoder::Size
11: v8::internal::wasm::LocalDeclEncoder::Size
12: v8_inspector::protocol::Debugger::API::SearchMatch::fromJSONString
13: v8_inspector::protocol::Debugger::API::SearchMatch::fromJSONString
14: 00000178DC106B21
我不确定要触发的其他内容是什么。也就是说,它试图对内存不足进行字符串化。
构建脚本”
"build": "npm run pre:build && react-app-rewired build && npm run post:build",
"pre:build": "yarn run build:css && rimraf build && rimraf mobile/www/app/*",
"post:build": "cp build/index.html mobile/www/ && cp build/* mobile/www/app --recursive",
Dev依赖项:
"devDependencies": {
"@types/react": "16.4.13",
"babel-core": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"chai": "^4.1.2",
"cra-build-watch": "^1.0.3",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-react": "^7.3.0",
"file-loader": "^1.1.11",
"gh-pages": "^1.0.0",
"html-webpack-plugin": "^3.2.0",
"karma": "^1.7.1",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-phantomjs-launcher": "^1.0.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.6",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.3",
"phantomjs-polyfill": "0.0.2",
"react-addons-test-utils": "^15.6.0",
"react-test-renderer": "^16.0.0",
"sinon": "^4.1.2",
"typescript": "^2.7.2",
"customize-cra": "^0.1.1"
},