Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate 'Javascript heap out of memory' error #356

Closed
chasulin opened this issue Nov 1, 2022 · 2 comments · Fixed by #399
Closed

Investigate 'Javascript heap out of memory' error #356

chasulin opened this issue Nov 1, 2022 · 2 comments · Fixed by #399
Labels
bug Something isn't working investigation Issues that need investigation and research packages A task for act-now-packages repo

Comments

@chasulin
Copy link
Contributor

chasulin commented Nov 1, 2022

An error saying "Javascript heap out of memory" popped up in the WorldMap component PR, and blocked the pr from building successfully (and deploying to firebase). The source of the error seems to be the generation of typedocs, and a quick fix was just to disable typedocs (remove yarn generate-docs from the build script) for now, so as to not block merging the WorldMap.

Things we've tried so far:

  • Doubling the amount of allotted memory
  • Upgrading typedocs
@mikelehen
Copy link
Contributor

It looks like this is a known typedoc issue: TypeStrong/typedoc#1606. They are working on it, with the last progress update 9 days ago.

@mikelehen
Copy link
Contributor

mikelehen commented Nov 15, 2022

I've found that if we generate docs directly from the package sources (yarn typedoc packages/*/src/index.ts) instead of using the "monorepo support" (yarn typedoc --entryPointStrategy packages . then it's a lot faster and uses less memory. The downside is the overall structure of the docs make it look like a single package with assert/src, metrics/src, etc. instead of separate modules (@actnowcoalition/assert, @actnowcoalition/metrics, etc.). This isn't ideal for our public facing docs, but I think is probably fine for right now.

One side benefit of this change is that it makes cross-linking classes across packages work, which is currently another Typedoc bug with monorepo support (TypeStrong/typedoc#1835).

When TypeStrong/typedoc#1606 is addressed, we can revisit this.

mikelehen added a commit that referenced this issue Nov 15, 2022
Typedoc has issues with monorepo support using lots of memory.  See #356 and TypeStrong/typedoc#1835.

This avoids the crash in two different ways:
1. I increased the node heap size to 8192 which seems to be sufficient to make the build succeed for now.
2. For now I am pointing typedoc at the source code directly rather than using the monorepo support. This uses a lot less memory and is a lot faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation Issues that need investigation and research packages A task for act-now-packages repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants