Using
"urql": "1.10.0"
"@urql/exchange-multipart-fetch": "0.1.8"
and typescript 4.0.2 there is a compile time error when adding the multipartFetchExchange in the exchanges on `createClient':
Type 'import(/node_modules/@urql/core/dist/types/types").Exchange' is not assignable to type 'import(/node_modules/urql/node_modules/@urql/core/dist/types/types").Exchange'.
Types of parameters 'input' and 'input' are incompatible.
Type 'import(/node_modules/urql/node_modules/@urql/core/dist/types/types").ExchangeInput' is not assignable to type 'import(/node_modules/@urql/core/dist/types/types").ExchangeInput'.
Types of property 'client' are incompatible.
Type 'import(/node_modules/urql/node_modules/@urql/core/dist/types/client").Client' is not assignable to type 'import(/node_modules/@urql/core/dist/types/client").Client'.
Types have separate declarations of a private property 'createOperationContext'.
Could you try running yarn why @urql/core or list out your @urql/core versions with npm. This would imply that you have a duplicate equivalent of @urql/core floating around. The one in urql doesn't seem deduplicated judging from the error.
You could try running yarn-deduplicate
That was the issue.
npm ci resolved the situation.
Thanks a ultra lot @JoviDeCroock
Thank you, @JoviDeCroock ! I just ran into the same issue when adding cacheExchange and devtoolsExchange, and this saved me from a ton of req squiggles in my IDE 馃帀
Hi! Can confirm this is still an issue in a yarn workspace environment.
Adding "workspaces": {
"nohoist": [
"@urql/**"
]
}, to packages/a/package.json fixed it for now :)
@Corjen that may lead to more issues in the future 馃槄 I鈥檇 still instead recommend to use yarn-deduplicate or even a resolution on @urql/Core to make sure that you only have one installation of the package and one entry for it in your lock file.
Nevermind 馃槃 removed the nohoist property, did a reinstall and it鈥檚 working now.
Most helpful comment
Could you try running
yarn why @urql/coreor list out your@urql/coreversions with npm. This would imply that you have a duplicate equivalent of@urql/corefloating around. The one inurqldoesn't seem deduplicated judging from the error.You could try running
yarn-deduplicate