Gatsby构建命令失败,并出现node_buffer错误:断言“长度<= kMaxLength”失败

时间:2019-07-19 20:40:27

标签: node.js gatsby

我正在尝试构建一个大型的Gatsby应用程序,并且遇到了一个低级错误,我认为这与在节点中创建新缓冲区时超出缓冲区大小限制有关。我正在寻找有关如何调试此问题的信息,以及盖茨比是否能处理这种规模的建筑物

------系统详细信息------

  System:
    OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver)
    CPU: (4) x64 Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
    Shell: 5.4.2 - /bin/zsh
  Binaries:
    Node: 10.16.0 - /usr/bin/node
    Yarn: 1.12.3 - /usr/bin/yarn
    npm: 6.9.0 - ~/.npm-global/bin/npm
  npmPackages:
    gatsby: ~2.9.0 => 2.9.11
    gatsby-plugin-google-analytics: ^2.0.7 => 2.0.20
    gatsby-plugin-lodash: ^3.0.2 => 3.0.5
    gatsby-plugin-manifest: ^2.0.14 => 2.1.1
    gatsby-plugin-offline: ^2.0.22 => 2.1.1
    gatsby-plugin-robots-txt: ^1.0.1 => 1.4.0
    gatsby-plugin-sass: ^2.0.3 => 2.0.11
    gatsby-plugin-sharp: ^2.0.18 => 2.1.3
    gatsby-plugin-sitemap: ^2.0.2 => 2.1.0
    gatsby-remark-external-links: 0.0.4 => 0.0.4
    gatsby-remark-responsive-iframe: ^2.0.8 => 2.1.1
    gatsby-source-filesystem: ^2.0.7 => 2.0.38
    gatsby-source-graphql: 2.0.7 => 2.0.7
    gatsby-source-mongodb: ^2.0.8 => 2.0.19
    gatsby-transformer-json: ^2.1.5 => 2.1.11
    gatsby-transformer-remark: ^2.1.11 => 2.3.12
    gatsby-transformer-sharp: ^2.1.12 => 2.1.21
  npmGlobalPackages:
    gatsby-cli: 2.4.6

给我这个错误的应用程序是lensa monorepo中的众多应用程序之一。我可以让较小的同级应用程序使用相同的依赖关系集进行构建。

我们使用的构建命令为"STAGE=dev node --max_old_space_size=20000 --expose-gc ./node_modules/.bin/gatsby build --prefix-paths --verbose"

我曾尝试缩小--max_old_space_size,但是在此过程的较早阶段中断了构建。

------错误日志------

success Building production JavaScript and CSS bundles - 21.341 s
success Rewriting compilation hashes - 0.094 s
success run page queries - 88.036 s — 8379/8379 95.34 queries/second

node[23526]: ../src/node_buffer.cc:420:v8::MaybeLocal<v8::Object> node::Buffer::New(node::Environment*, char*, size_t): Assertion `length <= kMaxLength' failed.
 1: 0x8f9d10 node::Abort() [node]
 2: 0x8f9de5  [node]
 3: 0x91b3ba  [node]
 4: 0x98f6e5  [node]
 5: 0xb8dfef  [node]
 6: 0xb8eb59 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x2844bd7dbe1d
[1]    23526 abort (core dumped)  STAGE=dev node --max_old_space_size=2000 --expose-gc  build --prefix-paths

0 个答案:

没有答案