apollo-angular
apollo-angular copied to clipboard
`ERR_UNSUPPORTED_DIR_IMPORT` or `EISDIR` with `vitest`
Describe the bug
It appears that when using vitest via https://analogjs.org/docs/features/testing/vitest the test suite will run into bizarre issues due to the way this library imports @apollo/client/core.
I'm not sure if it's a bug in this library or in vite/vitest. I also opened a bug report on their side: https://github.com/vitejs/vite/issues/15795
To Reproduce
Repro at: https://stackblitz.com/~/edit/vitest-dev-vitest-djnid1?initialPath=/vitest/
Expected behavior
No error
It appears the "correct" way is to change all the imports to @apollo/client/core/index.js as per: https://github.com/apollographql/apollo-client/pull/11570#issuecomment-1926627256