-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Error: Worker terminated due to reaching memory limit: JS heap out of memory #875
Comments
Same here. |
I have the same problem |
I have the same probleme but when I tested your tsconfig, it works. |
thank you @Achaak , I tried with "typeRoots": [] and it fixed the error. RAM reaches 4GB threshold when build. |
Wow! Thanks @Achaak. This also fixed the problem in our pipeline 🤯 |
Unfortunately, I am still encountering this issue despite the workarounds above. I have a React component library with ~40 components and a single entry point (though I tested multiple entry points). The builds (ESM and CJS in my case) are fast, but the |
# PR Overview ## Why Are We Making This Change? Both builds are failing ## How Is The Codebase Changing? – bump version to deploy – removed generation .d.ts files to handle out-of-memory issue on eas build – add preparation script before deploy ## Notes - [Issue OOM](egoist/tsup#875) https://expo.dev/accounts/hero24 <img width="1286" alt="Screenshot 2023-10-27 at 15 12 23" src="https://github.com/Helpdor/frontend/assets/4072250/0de326af-00e9-455f-9a76-bfe4b5cbe0c5">
same like @coopbri |
Have the same issue on TS only library (not React involved), and not even that large. The DTS step in order to be successful has pulled 14GB memory from my machine, this is unacceptable for CI runners. What I have tried but it didn't work:
Only thing that worked was downgrading to 6.6 as suggested. @egoist @sxzz Do you have any idea what could be the issue here? Providing minimal reproducing example may be harder since it mostly happens in medium to large codebases. |
Downgrading to 6.6 made me remove the top-level async logic from my Looking more into the issues, found #1018 that is somewhat expected to solve this, but not sure since running the build, it still take around 4GB. Probably part of my issue is (please confirm if true) that I am being lazy to define actual entry points so I wrote a method that fetches all the For reference, the build on tsup 6.6 takes <500MB with 1/10th of the time. |
After bit of debugging decided to time the hooks execution times. As suspected the rollup dts plugin is the culprit with the hook for |
As an extra data point (same as @coopbri) I can confirm that something in v6.7.0 has created a performance regression -- both in speed and memory usage (OOM). I tried v8.0.1 today and the problem still persists and seems worse now that my codebase is a little larger. Seems like this is most likely due to entry point count.
@ToTeTo I wouldn't say this is your issue because I have mine setup to do |
I have been using // tsup.config.ts
import { copyFile } from 'node:fs/promises'
import { exec } from 'node:child_process'
import { promisify } from 'node:util'
import glob from 'tiny-glob'
import { defineConfig } from 'tsup'
const pexec = promisify(exec)
export default defineConfig({
cjsInterop: true,
clean: true,
entry: ['src/**/*.ts', '!src/**/*.test.ts'],
format: ['cjs', 'esm'],
shims: true,
sourcemap: false,
splitting: true,
target: 'node20',
//
async onSuccess () {
try {
await pexec('tsc --emitDeclarationOnly --declaration')
const files = await glob('dist/**/*.d.ts')
await Promise.all(files.map(file => copyFile(file, file.replace('.d.ts', '.d.mts')))) // or to `.d.cjs` for "type": "module" projects
} catch (err) {
console.error()
console.error('Typescript compilation error:')
console.error()
console.error(err.stdout)
throw err
}
}
}) Don't forget to add |
As per #920 (comment) this may have been fixed upstream in Node v21 and above. Can someone please test and confirm if this is the case? |
Have you had any issues where ot generated wrong types |
Hi!
While building I am getting this error
I feel there is some issue with my
tsconfig.json
Here is the link to the currenttsconfig
which causes this issuehttps://github.com/WINOFFRG/limeplay/blob/c7b4342dc74cdbded43c0c39101eb8dd10bd98ac/packages/limeplay-core/tsconfig.json
Please check the root
tsconfig.json
as well! If I don't extend the root config to package config./tsconfig.json
topackages/limeplay-core/tsconfig.json
with the below configThe build succeeds but when extended with the config shared above in the URL, It fails. Here is the link to error from Actions
https://github.com/WINOFFRG/limeplay/actions/runs/4589372907/jobs/8104219650#step:4:224
Upvote & Fund
The text was updated successfully, but these errors were encountered: