triplit
triplit copied to clipboard
Tsconfig with `composite: true` has type errors when exporting schema
Example: The inferred type of 'schema' cannot be named without a reference to '../node_modules/@triplit/db/dist/types/data-types/boolean'. This is likely not portable. A type annotation is necessary.
Related issue - https://github.com/aspen-cloud/triplit/pull/149
Related to this PR: https://github.com/aspen-cloud/triplit/pull/149
TS Config file.
{
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
"useDefineForClassFields": true,
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"triplit/**/*.ts"
]
}
Similar error on client.ts
as well:
This is problematic because Vite by default has this configuration option. I dont actually think this is difficult to address, we just need to export a little more. Sorry for the delay, we should be able to fix soon.
Fixed in latest release: @triplit/client: 0.4.13