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
{{ message }}
Repository navigation
Memfs throwing an error after update to version 3Β #7266
Mocking filesystem with memfs as described here throws an error with version 3.
This is what I got using the example code:
Instead change the require of ...../node_modules/tslib/tslib.es6.mjs to a dynamic import() which is available in all CommonJS modules.
Error [ERR_REQUIRE_ESM]: require() of ES Module ...../node_modules/tslib/tslib.es6.mjs not supported.
Instead change the require of ...../node_modules/tslib/tslib.es6.mjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (...../node_modules/tree-dump/lib/index.js:3:17)
I'm also experiencing this, with Vitest 3, but only with Vite 6. Downgrading Vite to 5 (but keeping Vitest at version 3) 'fixes' it, so I suspect it is because of something which changed in Vite 6
As @sandhose mentioned the problem arises with Vitest version 3 and Vite version 6. For some reason downgrading to previous version make the issue disappear. It seems strange as the tree-dump is still there as a dependency of the memfs.
Forgot to mention that there is another issue with the example code as readHelloWorld would return a buffer and test would compare that buffer with texts. The function body would either need to be changed to readFileSync(path, { encoding: 'utf8', flag: 'r' }) to return string or the test would need to be modified to call .toString() each time the buffer value is compared to a text. The first solution seems to be more reasonable.
Activity
boldurean commentedon Jan 16, 2025
Same happens when using Mui with @emotion styles
vladkrasn commentedon Jan 16, 2025
I had similar errors with some other package on Node v22.6 and after updating to v22.13 they disappeared
sandhose commentedon Jan 16, 2025
I'm also experiencing this, with Vitest 3, but only with Vite 6. Downgrading Vite to 5 (but keeping Vitest at version 3) 'fixes' it, so I suspect it is because of something which changed in Vite 6
tsirlucas commentedon Jan 16, 2025
same issue. fixed by updating node to 22.13.
It works fine on 3.0.0-beta.4.
Primajin commentedon Jan 16, 2025
I can confirm updating node from 21 to 22 the error disappeared. However this feels a bit like slapping flex tape on a leaking water tank to me π€
Primajin/satellite-tracker@7927a2f
pjotrsavitski commentedon Jan 16, 2025
As @sandhose mentioned the problem arises with Vitest version 3 and Vite version 6. For some reason downgrading to previous version make the issue disappear. It seems strange as the
tree-dumpis still there as a dependency of thememfs.Forgot to mention that there is another issue with the example code as
readHelloWorldwould return a buffer and test would compare that buffer with texts. The function body would either need to be changed toreadFileSync(path, { encoding: 'utf8', flag: 'r' })to return string or the test would need to be modified to call.toString()each time the buffer value is compared to a text. The first solution seems to be more reasonable.