【问题标题】:Material UI Typescript Causing Node OOM in Webpack Dev ServerMaterial UI Typescript 在 Webpack Dev Server 中导致节点 OOM
【发布时间】:2018-04-25 10:49:11
【问题描述】:

我正在从 material-ui v0.19.1 升级到 v1.0.0-beta.20。 Webpack 开发服务器在启动时编译成功。但是,在第一次更改之后,节点抛出和 Out of Memory 以及下面的堆栈跟踪。看起来打字稿编译导致错误。我尝试按照https://github.com/Microsoft/TypeScript/issues/14628 上的步骤进行操作,但没有成功。

94% asset optimization
[at-loader] Checking started in a separate process...

<--- Last few GCs --->

  41632 ms: Mark-sweep 1373.4 (1435.0) -> 1373.2 (1435.0) MB, 752.7 / 0.0 ms [allocation failure] [GC in old space requested].
  42331 ms: Mark-sweep 1373.2 (1435.0) -> 1373.2 (1435.0) MB, 698.9 / 0.0 ms [allocation failure] [GC in old space requested].
  43081 ms: Mark-sweep 1373.2 (1435.0) -> 1377.5 (1419.0) MB, 749.8 / 0.0 ms [last resort gc].
  43802 ms: Mark-sweep 1377.5 (1419.0) -> 1381.9 (1419.0) MB, 720.2 / 0.0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x2673a12cf781 <JS Object>
   2: /* anonymous */(aka /* anonymous */) [/Users/name/work/project/node_modules/typescript/lib/typescript.js:24378] [pc=0x3e6e0378c55b] (this=0x2673a1204381 <undefined>,symbol=0x3e7ad43914c1 <a SymbolObject with map 0x2daa61c87129>,id=0x15b6ee481b41 <String[8]: children>)
   3: arguments adaptor frame: 3->2
   4: forEach [native collection.js:~335] [pc=0x3e6e03767052] (this=...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/local/bin/node]
2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
4: v8::internal::Handle<v8::internal::AllocationSite> v8::internal::Factory::New<v8::internal::AllocationSite>(v8::internal::Handle<v8::internal::Map>, v8::internal::AllocationSpace) [/usr/local/bin/node]
5: v8::internal::Factory::NewAllocationSite() [/usr/local/bin/node]
6: v8::internal::AllocationSiteCreationContext::EnterNewScope() [/usr/local/bin/node]
7: v8::internal::CreateArrayLiteralImpl(v8::internal::Isolate*, v8::internal::Handle<v8::internal::LiteralsArray>, int, v8::internal::Handle<v8::internal::FixedArray>, int) [/usr/local/bin/node]
8: v8::internal::Runtime_CreateArrayLiteralStubBailout(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
9: 0x3e6e029079a7
10: 0x3e6e0292be25
error Command failed with signal "SIGABRT".

看起来问题是由打字稿引起的。我试过了

【问题讨论】:

    标签: typescript webpack material-ui webpack-dev-server


    【解决方案1】:

    问题是我使用的是awesome-typescript-loader 而不是官方的ts-loaderts-loader 已经遇到并解决了这个问题(我认为这与复杂的泛型有关)。切换到ts-loader 解决了这个问题。

    【讨论】:

    • 考虑在你的加载器中禁用类型检查,而不是通过命令行或从你的IDE运行它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-12
    • 1970-01-01
    • 2018-04-29
    相关资源
    最近更新 更多