Skip to content

error TS2339: Property 'X' does not exist on type '{}'. #865

@ilyasa1211

Description

@ilyasa1211

Describe the bug

I run npm run build then got this error

src/renderer/src/App.tsx:11:15 - error TS2339: Property 'X' does not exist on type '{}'.

11   window.api?.X();
                 ~~~
// App.tsx
function exampleOnly() {
  window.api?.X();
}

Which I know the error is from:

// package.json
    "build": "npm run typecheck && electron-vite build",

which then resolve to:

// package.json
    "typecheck": "npm run typecheck:node && npm run typecheck:web",

which is

// package.json
    "typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
npm run typecheck:web

src/renderer/src/App.tsx:11:15 - error TS2339: Property 'X' does not exist on type '{}'.

11   window.api?.X();
                 ~~~

Electron-Vite Version

"electron-vite": "^5.0.0",

Electron Version

"electron": "^39.2.6",

Vite Version

"vite": "^7.2.6"

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions