You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Angular build fails with malloc error on second build
Description
When running the Angular build command twice in succession, the second build fails with a malloc error. The first build completes successfully, but subsequent builds fail with a memory-related error.
node(71866,0x20647cf40) malloc: *** error for object 0x3bb90e420460: pointer being freed was not allocated
node(71866,0x20647cf40) malloc: *** set a breakpoint in malloc_error_break to debug
sh: line 1: 71816 Abort trap: 6 npm run build-ui
Steps to Reproduce
Run first build command: npm run deploy
Result: Build succeeds
Run second build command: npm run deploy
Result: Build fails with malloc error
Proposed Solutions
Solution 1: Clear Angular CLI Cache
Running ng cache clean resolves the issue.
Solution 2: Add Clean Step to Build Process
Adding a clean step to the build-ui script in package.json:
{
"scripts": {
"build-ui": "npm run clean --prefix src/ui && npm run build --prefix src/ui"
}
}
Additional Context
The error appears to be related to Angular CLI's cache management. Either clearing the cache manually or implementing an automatic clean step before builds prevents the malloc error from occurring.
Questions
Are these solutions effective for all environments and Angular versions?
Is there a more fundamental solution that addresses the root cause of the malloc error?
Could this be related to a specific version of the Angular CLI or Node.js?
The text was updated successfully, but these errors were encountered:
Angular build fails with malloc error on second build
Description
When running the Angular build command twice in succession, the second build fails with a malloc error. The first build completes successfully, but subsequent builds fail with a memory-related error.
Environment
Error Message
Steps to Reproduce
npm run deploy
npm run deploy
Proposed Solutions
Solution 1: Clear Angular CLI Cache
Running
ng cache clean
resolves the issue.Solution 2: Add Clean Step to Build Process
Adding a clean step to the build-ui script in package.json:
Additional Context
The error appears to be related to Angular CLI's cache management. Either clearing the cache manually or implementing an automatic clean step before builds prevents the malloc error from occurring.
Questions
The text was updated successfully, but these errors were encountered: