-
Notifications
You must be signed in to change notification settings - Fork 12k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
NG 12 partial compilationMode causes out of memory error #21041
Comments
Hi @restfulhead thanks for reporting. Can you try building the app with |
Ok, I narrowed it down. If I remove the following from TSConfig the error seems to no longer occur:
The reason Dev build:
Prod build:
Currently waiting for a full build. @JoostK Tried to disable source maps, too, but that did not seem to have any effect. |
That is super interesting, I can't tell from the top of my head how that would influence the build and result in runaway memory usage. It would be great to narrow this down to a minimum reproduction that can be shared, do you think that's feasible to setup? |
Not sure if it will occur in a simple project setup. But if I find some time in the next couple of days, I'll create a repository with a similar project/ts-config setup to find out. |
Hi @JoostK, I am experiencing a similar issue on a project using a larger shared library (25 modules). In my case, setting |
@JoostK Here's a repository with a project structure similar to where the issue occurs: https://github.com/restfulhead/ng-lib-and-app. Unfortunately (or fortunately) building with As mentioned in my comment above, disabling path mapping for production builds works for me, so from my end, we could close this issue. |
@restfulhead, I downloaded your reproduction and I wasn't able to reproduce the issue (OOM) you reported. Unfortunately, without a reproduction or at the very minimum memory heap snapshots it would be hard to get to the bottom of this. |
@alan-agius4 I saw a comment about a memory leak. Sounds like it could be related. I would like to wait for that fix to land to see if it solves the issue here. If not, I can add more information such as a memory snapshot. |
@restfulhead the leak only concerns watch builds, is that the case for you? Anyway, you could try the snapshot as I mentioned in #20801 (comment). |
Oh, I see. Ok, no, this issue is not related to watch builds. Ok, I will add the snapshot when I find some time. |
Installing After further testing, I now believe it is indeed related to source maps. I think when I tested it before, I turned off source maps in tsconfig but missed to disable it in |
I'm getting the same issue. Seems to be resolved with disabling generation of source maps. |
@Supratentorial / @restfulhead can anyone of you please share a reproduction? Without this it would be hard to get to the bottom of this. |
got that when switching to another branch with massive changes, recompilation process hang to out of memory. |
This is the latest build of super productivity failing on github actions (runs fine on my machine though): Steps to reproduce this:
|
@johannesjo, unless I am missing something it doesn鈥檛 appear that in your repo you have a dependency on a partially compiled Angular library. |
@alan-agius4 that's right. My mistake. |
I've just had similar issue, deleting node_modules & package-lock.json then running 'npm install' helped. |
Unfortunately, there isn鈥檛 enough information for us to investigate this any further. If the issue persists please file a new issue with a reproduction. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
馃悶 Bug report
Command (mark with an
x
)Is this a regression?
Not sure, before NG12 we did not use the
compilationMode
setting and we disabled Ivy for production builds.Description
We have a library project and a main app project. When setting
compilationMode
topartial
in the library build, then running or building the app project (which depends on the library) fails withFATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
. Increasing memory to up to 8GB viamax_old_space_size
did not help. The node process keeps allocating more memory until it fails eventually. That's on my local OSX. On GitHub actions the build works, but the test fails with the same error.Building and starting works fine when setting compilationMode to
full
. However, we want to publish our library to an internal NPM registry, so we need to set compilationMode topartial
.To make things worse, disabling Ivy no longer works either (
"enableIvy": false
). Depending on a combination of angularCompilerOptions I either getERROR: Angular structure loaded both synchronously and asynchronously
orFunction calls are not supported in decorators but '***Module' was called.
馃敩 Minimal Reproduction
Parent tsconfig
Library tsconfig
App tsconfig
馃敟 Exception or Error
Error on my local during build
Error on GitHub actions during test
The text was updated successfully, but these errors were encountered: