-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Big error and I have no idea what it means. #1608
Comments
Had another error happen in production on me. Still no idea how to debug this. Can anyone give me insight of what to check first? I'm a JS dev and know next to nothing about Go.
|
And I just got this locally. I don't think I was even doing anything on my server. Seemed to happen just randomly. Unfortunately there's so much logged that the VSCode terminal didn't keep it all, but here's the last of it: https://gist.github.com/kentcdodds/ca50dcea326e4851d79596e39683f771 (even that is too big for github). I really have no idea where to go from here... |
These logs look like the tail end of an error message. The actual error message comes first and appears to be missing from these logs. Unfortunately that means what you posted doesn't contain any actionable information. |
Ah, ok, in that case I'll run my server with Terminal.app so I don't lose the more helpful first bit of the error next time this happens. Thanks! |
Alright, I've reproduced it locally and got all the logs. Here's the full thing: https://gist.github.com/kentcdodds/611a567add80fff3259617db4d8d880d And here's the first bit:
From what I can tell this means my system ran out of memory. In production I've had one or two out of memory errors as well and I'm guessing this was the culprit. For additional relevant context, I'm using mdx-bundler which uses xdm + esbuild to compile ~200 mdx files. Here's some relevant code with comments explaining that I thought about this ahead of time 😅 async function getMdxPagesInDirectory(
contentDir: string,
options: CachifiedOptions,
) {
const dirList = await getMdxDirList(contentDir, options)
// our octokit throttle plugin will make sure we don't hit the rate limit
const pageDatas = await Promise.all(
dirList.map(async ({slug}) => {
return {
files: await downloadMdxFilesCached(contentDir, slug, options),
slug,
}
}),
)
const pages: Array<MdxPage> = []
for (const pageData of pageDatas) {
// esbuild is already optimized to use as many resources as possible
// so we don't want these running at the same time otherwise we'll
// run out of memory.
// eslint-disable-next-line no-await-in-loop
const page = await compileMdxCached(
contentDir,
pageData.slug,
pageData.files,
options,
)
if (page) pages.push(page)
}
return pages
} The Anyway, at this point I'm not sure how actionable this is for you all. I'll add some logging in place to make sure that I'm not inadvertently compiling two things at once and if I am then I know it's my problem, not yours. I think at this point, unless you just know a solution off the top of your head, wait for me to report back whether I can determine whether I'm running compilation in parallel. Thanks for your patience here. |
Alrighty, I was able to determine that I was indeed running this code multiple times in parallel leading to the OOM error. My bad. I'm putting some stuff in place to make sure I don't have this problem in the future (some I don't think there's anything that can be done here (though maybe clipping some of the output by default would be helpful so it's not so difficult to find the useful output would be nice). Thanks! |
Unfortunately that's done by the Go runtime and not by esbuild, so that's not something I can change. |
I'm using
mdx-bundler
which uses esbuild under the hood. Occasionally I'll get the following output and I have no idea what it means. I can try to make a reproduction if needed, but maybe someone can tell me more about the error so I know what I'm trying to reproduce?I've seen giant errors like this in production as well as locally. I'm just not sure what to do when I see this kind of error. It doesn't make any sense to me so I'm not sure what to do about it 😅
The text was updated successfully, but these errors were encountered: