Property db doesn't exist on XataClient
With the code But when I try I get the error:
Property 'db' does not exist on type 'XataClient'Property 'db' does not exist on type 'XataClient'import { getXataClient } from "../../xata";
const xata = getXataClient();
console.log(xata)
// returns
// XataClient {
// db: {},
// search: { all: [AsyncFunction: all], byTable: [AsyncFunction: byTable] },
// transactions: { run: [AsyncFunction: run] }
}console.log(xata.db);../../xata is the location of xata.ts (which defaults to src/xata.ts from the place where you do xata init) ?xata init which configures your current directory, that downloads the xata client module in node_modules and at the same time generates a file in the location src/xata.ts which contains your types, db details etc. This is the place you should get the xata client from, so we need to make sure that file corresponds to the path we're importing. This file extends the xata client node module with your own database specifics / types. xata codegen to update your client file with the latest changes.../../xata is correct and finds the src/xata.ts file. I've ran xata codegen again, which updated the tables array (with the new table that I created), but still I get the same errorsxata init --force to re-init the project, which yet again didn't workProperty 'db' does not exist on type 'XataClient' using some module/target combinations. Can you paste your tsconfig.json?5.0.4../../xata../../xataxata initxata initxata codegenxata codegenxata init --force5.0.4{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"target": "ES6",
"outDir": "./dist",
"resolveJsonModule": true,
"skipLibCheck": true
},
"include": ["src/**/*"]
}