triplit icon indicating copy to clipboard operation
triplit copied to clipboard

Tsconfig with `composite: true` has type errors when exporting schema

Open wernst opened this issue 1 year ago • 3 comments

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.

wernst avatar Nov 02 '23 23:11 wernst

Related issue - https://github.com/aspen-cloud/triplit/pull/149

wernst avatar Jul 14 '24 17:07 wernst

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"
  ]
}

bqrkhn avatar Jul 15 '24 04:07 bqrkhn

Similar error on client.ts as well:

Capture-2024-07-16 at 15 15 19

bqrkhn avatar Jul 16 '24 09:07 bqrkhn

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.

wernst avatar Sep 14 '24 23:09 wernst

Fixed in latest release: @triplit/client: 0.4.13

wernst avatar Sep 18 '24 00:09 wernst