Skip to content

Build fail because of TypeScript error #94

Open
@aymericzip

Description

@aymericzip

Thanks for this awesome tool.

  • Check if updating to the latest preact-iso version resolves the issue

Describe the bug
On a vite / preact app, the build fail when the "skipLibCheck": false, is set (or undefined)
Error list

> vite-preact-app-example@0.0.0 build /Users/aymericpineau/Documents/intlayer/examples/vite-preact-app
> tsc -b && vite build

../../node_modules/.pnpm/@preact+preset-vite@2.10.1_@babel+core@7.27.1_preact@10.26.6_vite@6.3.5_@types+node@22._9bdfb6acc424a5d7c97567e6f039ee02/node_modules/@preact/preset-vite/dist/esm/index.d.mts:2:36 - error TS7016: Could not find a declaration file for module '@rollup/pluginutils'. '/Users/aymericpineau/Documents/intlayer/node_modules/.pnpm/@rollup+pluginutils@4.2.1/node_modules/@rollup/pluginutils/dist/es/index.js' implicitly has an 'any' type.
  There are types at '/Users/aymericpineau/Documents/intlayer/node_modules/.pnpm/@preact+preset-vite@2.10.1_@babel+core@7.27.1_preact@10.26.6_vite@6.3.5_@types+node@22._9bdfb6acc424a5d7c97567e6f039ee02/node_modules/@rollup/pluginutils/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@rollup/pluginutils' library may need to update its package.json or typings.

2 import type { FilterPattern } from "@rollup/pluginutils";
                                     ~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/preact-iso@2.9.1_preact-render-to-string@6.5.13_preact@10.26.6__preact@10.26.6/node_modules/preact-iso/src/router.d.ts:18:2 - error TS2411: Property 'params' of type '{ [param: string]: string; }' is not assignable to 'string' index type 'string'.

18  params: {
    ~~~~~~

../../node_modules/.pnpm/preact-iso@2.9.1_preact-render-to-string@6.5.13_preact@10.26.6__preact@10.26.6/node_modules/preact-iso/src/router.d.ts:21:2 - error TS2411: Property 'rest' of type 'string | undefined' is not assignable to 'string' index type 'string'.

21  rest?: string;
    ~~~~

../../node_modules/.pnpm/preact-iso@2.9.1_preact-render-to-string@6.5.13_preact@10.26.6__preact@10.26.6/node_modules/preact-iso/src/router.d.ts:24:2 - error TS2411: Property 'params' of type '{ [param: string]: string; }' is not assignable to 'string' index type 'string'.

24  params: {
    ~~~~~~

../../node_modules/.pnpm/preact-iso@2.9.1_preact-render-to-string@6.5.13_preact@10.26.6__preact@10.26.6/node_modules/preact-iso/src/router.d.ts:27:2 - error TS2411: Property 'rest' of type 'string | undefined' is not assignable to 'string' index type 'string'.

27  rest?: string;
    ~~~~

../../node_modules/.pnpm/preact-iso@2.9.1_preact-render-to-string@6.5.13_preact@10.26.6__preact@10.26.6/node_modules/preact-iso/src/router.d.ts:63:41 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members.

63   interface IntrinsicAttributes extends RoutableProps {}
                                           ~~~~~~~~~~~~~

../../node_modules/.pnpm/preact-iso@2.9.1_preact-render-to-string@6.5.13_preact@10.26.6__preact@10.26.6/node_modules/preact-iso/src/router.d.ts:65:31 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members.

65  interface Attributes extends RoutableProps {}
                                 ~~~~~~~~~~~~~


Found 7 errors.
{
  "name": "vite-preact-app-example",
  "type": "module",
  "scripts": {
    "build": "tsc -b && vite build",
    "dev": "vite",
    "preview": "vite preview",
    "start:editor": "intlayer-editor start"
  },
  "dependencies": {
    "preact": "^10.26.4",
    "preact-iso": "^2.9.1"
  },
  "devDependencies": {
    "@preact/preset-vite": "^2.10.1",
    "typescript": "~5.7.2",
    "vite": "^6.3.1",
    "vite-intlayer": "workspace:*"
  }
}

Note that skipping the external package type checking make the build pass. The code logic is not impacted

To Reproduce

GitHub demo repo

Steps to reproduce the behavior:

  1. install the packages
  2. set "skipLibCheck": true in the tsconfig.json file
  3. build the app

Expected behavior
Build should pass without "skipLibCheck": true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions