-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ERR_UNSUPPORTED_DIR_IMPORT
when importing @apollo/client/core
#11569
Comments
The correct solution could be to implement export maps. Here's some inspiration from https://yarnpkg.com/package?q=%40angular%2Fcore&name=%40angular%2Fcore&file=%2Fpackage.json |
I opened PR #11570 with a change to build the export maps. |
Hi @andreialecu 👋 The discussion related to this issue occurred over on your PR #11570 but I wanted to close the loop here: given kamilkisiela/apollo-angular#2172, and since we already have a tracking issue for adding |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
I was migrating a test suite from
jest
tovitest
, which seems to be stricter about how imports are handled, and ran into an issue whereapollo-angular
imports from@apollo/client/core
, but this results in this error:The documentation mentions that imports from
@apollo/client/core
are recommended in: https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/#using-apollo-client-without-reactI initially created a bug report in Vite here: vitejs/vite#15795
A contributor there pointed out that this also fails with pure Node, which is true.
This was previously mentioned in the issue #9925 but was closed without being looked at.
I suspect this may become much more visible shortly because Angular is migrating to Vite for its build system, so it may uncover this issue for users of
apollo-angular
at least.Related issues:
#9925
vitejs/vite#15795
kamilkisiela/apollo-angular#2172
Link to Reproduction
https://stackblitz.com/~/edit/vitest-dev-vitest-smbxnz?file=repro.mjs
Reproduction Steps
No response
@apollo/client
version3.9.2
The text was updated successfully, but these errors were encountered: