brillout / telefunc

Remote Functions. Instead of API.
https://telefunc.com
MIT License
688 stars 31 forks source link

typescript: Cannot find module 'telefunc/vite' or its corresponding type declarations #91

Closed pencilcheck closed 1 year ago

pencilcheck commented 1 year ago

I used vike to create the initial template for the starter app.

It contains tsconfig.json

{
  "compilerOptions": {
    "strict": true,
    "module": "ES2020",
    "target": "ES2020",
    // Doesn't apply to server/, see ts-node config down below and server/tsconfig.json
    "moduleResolution": "Bundler",
    "lib": ["DOM", "DOM.Iterable", "ESNext"],
    "types": ["vite/client"],
    "jsx": "react-jsx",
    "skipLibCheck": true,
    "esModuleInterop": true
  },
  "ts-node": {
    "transpileOnly": true,
    "esm": true,
    "compilerOptions": {
      "module": "Node16",
      "moduleResolution": "Node16"
    }
  }
}

I then followed the steps on telefunc to install telefunc, I install the package dependencies using pnpm, then I tried to add the vite plugin.

The website seems to run, but my typescript server keeps warning me that it cannot find the type declaration, when it is clearly inside node_modules

If anyone can help me this will be greatly appreciated.

brillout commented 1 year ago

👍 Reproduction or PR welcome. I'll re-open then.