Skip to content

Commit a93fa94

Browse files
committed
add crucial comment
1 parent b85ef27 commit a93fa94

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/mdx.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ type SlugFile = {
5454
};
5555

5656
const root = process.cwd();
57+
// We need to limit this as we have code doing things like Promise.all(allFiles.map(...))
58+
// where `allFiles` is in the order of thousands. This not only slows down the build but
59+
// it also crashes the dynamic pages such as `/platform-redirect` as these run on Vercel
60+
// Functions which looks like AWS Lambda and we get `EMFILE` errors when trying to open
61+
// so many files at once.
5762
const FILE_CONCURRENCY_LIMIT = 200;
5863
const CACHE_COMPRESS_LEVEL = 4;
5964
const CACHE_DIR = path.join(root, '.next', 'cache', 'mdx-bundler');

0 commit comments

Comments
 (0)