"EMFILE: too many open files" error when testing Cesium app with Vitest

Hi. I have a web app created with Vue/Vite/Vitest/Typescript that uses Cesium.

I am importing Cesium in some parts of the app like this:
import { Resource as CesiumResource } from “cesium”;

Sometimes the Vitest tests show an error “EMFILE: too many open files ” and cannot use that Vitest test.

The only workaround I have find is to set fileParallelism to false in Vitest settings in vite.config.js. This make testing slower but seems the number of files opened is under limits.

Some clue on why this happens? Is it related to Cesium declaration file Cesium.d.ts to be one big file instead of each JS file having its one d.ts? I have created apps with other geographic libraries like Openlayers (that has one d.ts file per module) and never had this error.

Hi @Jose_Antonio_Hernand,

Offhand, I’m not sure. Though I would doubt it has to do with the typescript definitions file. Could you explain a bit more about the content of the tests in question?