R159 + Vite, ModelNode.js:26 Uncaught TypeError: nodeImmutable(...).label(...).temp is not a function

I resolved this using Vite config’s optimizeDeps.exclude !

  // ...
  optimizeDeps: {
    exclude: [
      'three', // to prevent Vite's code chunking which causes an error
    ],
    esbuildOptions: {
      target: 'esnext', // Three.js uses top-level await
    },
  },
  // ...
1 Like