-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
The "main" bundle of v4 is in AMD format #1081
Comments
Webpack should use the ESM version. 🤷 |
On the server bundle it tries to use the one from "main" in |
@Akryum Same issue here. After upgrading to I fixed it by downgrading to
|
Hey @Akryum, |
I get the same error using this with nuxt & typescript. I just was trying to do import import { DefaultApolloClient } from "@vue/apollo-composable"; This is definitely suddenly broken. Is there any reason for the switch to "amd"? Nuxt version: "nuxt": "2.14.7", |
I cloned the branch in #1089 and then how to build workspace package cd packages/vue-apollo-composable
yarn build
yarn pack
mv vue-apollo-composable-v4.0.0-alpha.12.tgz $yourproject
cd $yourproject
npm install ./vue-apollo-composable-v4.0.0-alpha.12.tgz |
@JoeSchr I wasn't able to spend more time on it and decided to go back to the regular usage without the composition-api on pages where I need two clients. I am waiting for a new release of vue-apollo-composables, that hopefully will fix this issue and then do a refactoring. |
Same problem here folks, tried to upgrade but now jest is now throwing the error reported above: |
Hello, I have the same problem. I'm using Vue 3 in ssr |
As a workaround, you can fix the errors in Jest by doing the following: Change your Add the following to your Jest config: moduleNameMapper: {
// Override which bundle Jest imports from
'@vue/apollo-composable': '@vue/apollo-composable/dist/index.js',
},
// If you get `Unexpected token` on import/export, add this to transform the @vue/apollo-composable bundle
transformIgnorePatterns: ['/node_modules/(?!@vue/apollo-composable).+\\.js$'], |
Is there any workarround for nuxt ? |
@leo91000
Works with the newest version. No need to revert back to alpha10. |
Is there any workaround for Webpack? :) |
I changed in the tsconfig "module": "esnext" with that the problem was solved for me |
@JoeSchr I found a workaround: vuesion/vuesion#552.
|
I tried all the above solutions, none of them worked in my case. I am using Vue2, Vuetify and @vue/apollo-composable@4.0.0-alpha.12. |
The build process has been changed and will be released in alpha.13 |
Describe the bug
The "main" bundle of v4 is in AMD format. Is it intended? It used to be commonjs, and it seems it was changed in cfbb9da.
So now bundle contains code like:
And I keep getting
ReferenceError: define is not defined
. I am using webpack 4 to build my app.Expected behavior
The bundle should be in commonjs format.
Versions
apollo-client: 4.0.0-alpha.12
Additional context
If this was intended, can you please explain the reasons behind this decision?
The text was updated successfully, but these errors were encountered: