illustspace / aframe-typescript-class-components

A simple tool for writing Aframe components as TypeScript classes.
https://www.npmjs.com/package/aframe-typescript-class-components
MIT License
12 stars 1 forks source link

Vite: [ERROR] Could not resolve "three/types" #7

Open Atlinx opened 1 year ago

Atlinx commented 1 year ago

Hey all, I'm using Vite as my bundler and I'm getting the error when I import classes from aframe-typescript-class-components:

X [ERROR] Could not resolve "three/types"

Does anyone know why this is happening?

Atlinx commented 1 year ago

It seems like it was a vite issue. I updated my vite.config.ts to exclude this:

// vite.config.ts
export default defineConfig({
  optimizeDeps: {
    exclude: ["three/types"],
  },
})
Atlinx commented 1 year ago

Nevermind, it seems like vite still attempts to import "three/types" when you load the HTML page, which fails.