-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Named export 'DefaultApolloClient' not found! #241
Comments
@shamscorner can you try adding |
@userquin Much appreciated that 🙂 |
I've updated my fork here https://github.com/userquin/vitesse-stackter-clean-architect (check last commit), we only need to patch These changes will allow you to use // src/common/ApolloClient.ts
import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client' // just remove the `core/index.js` from the original |
My fork is using |
Excellent! I really like this solution 😍. It is working as expected. |
Try removing the dependency, but it seems it is using some react stuff... |
@shamscorner I cannot check removing the |
I tried to use this patch but it didn't work for me I pulled your repo and it really works. but my project is much bigger. Hope maybe somebody may assist in it |
For anyone still facing this issue I found a workaround, after hours struggling, using pnpm-patch-i.
"type": "module",
"sideEffects": false, to the root of the JSON document, so it ends up something like this: {
// ...
"type": "module",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.esm.js",
"require": "./dist/index.js"
},
"./*": "./*"
},
// ...
}
Now if you run Tested using:
Works with pnpm, not sure if it works with other package managers, but there is also https://github.com/ds300/patch-package and process should be the same |
The following error is happening when building the project (
pnpm build
). However,pnpm dev
is working fine and graphql is also fetching data properly. You can try with this Repository if you want. Everything is set up, just clone and runpnpm build
.App.vue setup
Console error when running
pnpm build
The text was updated successfully, but these errors were encountered: