threejs, typescript and vite => everything threejs is any
Hi all,
I am coding a dead simple threejs experience where I hoped to be able to use typescript. But all that's imported from the three import is considered as any and there is no way to navigate to the source definition :/
Here is the project config: Deno 2.1.7
deno.json
{ "tasks": { "dev": "deno run -A --node-modules-dir npm:vite", "build": "deno run -A --node-modules-dir npm:vite build", "preview": "deno run -A --node-modules-dir npm:vite preview", "serve": "deno run --allow-net --allow-read jsr:@std/http@1/file-server dist/" }, "compilerOptions": { "lib": ["ES2020", "DOM", "DOM.Iterable"] }, "imports": { "@deno/vite-plugin": "npm:@deno/vite-plugin@^1.0.0", "@types/three": "npm:@types/three@^0.172.0", "three": "npm:three@^0.172.0", "vite": "npm:vite@^6.0.1" }, "lint": { "rules":{ "exclude": ["no-window", "no-window-prefix"] } }}
{ "tasks": { "dev": "deno run -A --node-modules-dir npm:vite", "build": "deno run -A --node-modules-dir npm:vite build", "preview": "deno run -A --node-modules-dir npm:vite preview", "serve": "deno run --allow-net --allow-read jsr:@std/http@1/file-server dist/" }, "compilerOptions": { "lib": ["ES2020", "DOM", "DOM.Iterable"] }, "imports": { "@deno/vite-plugin": "npm:@deno/vite-plugin@^1.0.0", "@types/three": "npm:@types/three@^0.172.0", "three": "npm:three@^0.172.0", "vite": "npm:vite@^6.0.1" }, "lint": { "rules":{ "exclude": ["no-window", "no-window-prefix"] } }}
vite.config.ts
import { defineConfig } from 'vite'import deno from '@deno/vite-plugin'// https://vite.dev/config/export default defineConfig({ plugins: [deno()],})
import { defineConfig } from 'vite'import deno from '@deno/vite-plugin'// https://vite.dev/config/export default defineConfig({ plugins: [deno()],})
What am I missing ?
I also have copilot but he wont autocomplete anything as well but that's another problem
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
D
Deno
Chat about Deno, a modern runtime for JavaScript and TypeScript.