概要
表題のとおりのミスをやらかしたのでメモ。
tsconfigの設定をいじっている間におかしくなってしまったらしい。
解決法
node_modules
をincludeから外したら解決した。
そもそもnode_modulesをトランスパイルしようとしているのがおかしい(参考: tsconfigオプション)。
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"paths": {
"@/*": ["../../client/src/*"]
}
},
"include": [
".storybook",
"../../client/src",
"./stories"
- ,"./node_modules"
]
}
エラー
Reactでstorybook起動時にJavaScript heap out of memoryが出たけど解決した話とは原因が別だったもよう。
95% emitting fork-ts-checker-webpack-plugin
<--- Last few GCs --->
[2292:00000270E5D31270] 112199 ms: Mark-sweep (reduce) 2047.6 (2083.2) -> 2047.0 (2083.7) MB, 1822.8 / 0.1 ms (+ 66.7 ms in 17 steps since start of marking, biggest step
8.3 ms, walltime since start of marking 1901 ms) (average mu = 0.542, current mu =
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF6AFC8013F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112495
2: 00007FF6AFC0F396 DSA_meth_get_flags+65526
3: 00007FF6AFC1024D node::OnFatalError+301
4: 00007FF6B05419EE v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF6B052BECD v8::SharedArrayBuffer::Externalize+781
6: 00007FF6B03CF61C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
7: 00007FF6B03CC754 v8::internal::Heap::CollectGarbage+4244
8: 00007FF6B03CA0D0 v8::internal::Heap::AllocateExternalBackingStore+2000
9: 00007FF6B03EEA06 v8::internal::Factory::NewFillerObject+214
10: 00007FF6B0121CD5 v8::internal::DateCache::Weekday+1797
11: 00007FF6B05CF3E1 v8::internal::SetupIsolateDelegate::SetupHeap+494417
12: 00000270E7B68B25