solid-trpc icon indicating copy to clipboard operation
solid-trpc copied to clipboard

query.ts:359 As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']

Open avjabalpur opened this issue 11 months ago • 2 comments

Hi,

I am trying to use this in my solid-js application, I am getting the following exception while calling my hook for getting the data

query.ts:359 As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']

and My function is const res = trpc.terms.getTerms.useQuery();

avjabalpur avatar Jul 31 '23 16:07 avjabalpur

Hi,

I am trying to use this in my solid-js application, I am getting the following exception while calling my hook for getting the data

query.ts:359 As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']

and My function is

const res = trpc.terms.getTerms.useQuery();

Can you make a full repro? Not sure exactly what is going on

OrJDev avatar Aug 24 '23 16:08 OrJDev

@avjabalpur I had the same issue when I was using the code from the README in the next branch, but I was able to resolve it by upgrading: "@tanstack/solid-query": "^4.33.0", --> "@tanstack/solid-query": "^5.0.0-beta.15",. It seems like the installation instructions from the README installs @tanstack/solid-query: v4.33.0 (as of writing this), but the beta version is required -- in fact, Create JD App produces a package.json with the beta version installed and works fine.

I hope that helps

jmoon018 avatar Aug 29 '23 21:08 jmoon018