Xata Starter Guide Next.JS trouble
Just following allong with the Getting Started with Next.js and Xata guide and I'm getting this error:
on the step where I'm replacing the content in the home page here:
I'm getting a TS error saying: "Property 'db' does not exist on type 'XataClient'.ts(2339)" and also in my xata.ts file autogenerated, I'm getting the errors: "Cannot find module
or its corresponding type declarations." and Cannot find module 'npm:@xata.io/client@latest' or its corresponding type declarations.
"
1 Reply
Hi! Seems like the
@xata.io/client
has not been installed.
The xata client is installed by the CLI during xata init
, which automatically downloads the client module in the local node_modules directory within your project folder.
Is @xata.io/client
listed in the dependencies of the package.json in "xata-nextjs"?
If not, it's likely that some commands where not run in the same order as in the guide or that the npm package manager isn't well configured.
Try: npm install @xata.io/client --save
in the "xata-nextjs" folder. This is the same command that the Xata CLI (during xata init) should run.
Also, make sure you've installed node.js and npm
and running a recent version (npm --version
) of npm (npm update -g
) - unless you're explicitly using an alternative package manager other than npm.