Slow intellisense/suggestions
Describe the bug
Hi, does anyone have problems with slow IntelliSense/suggestions in VSCode ? I’ve been trying to debug this issue in my large app for the past few days, where suggestions appear after 2-6 seconds. After a long time, the only thing that helped was removing Three.js. Is anyone else facing this issue, or perhaps have a solution? Thanks.
with nuxt tresjs https://github.com/user-attachments/assets/dc468410-fb08-4961-a6f9-b3102b24ab77
without nuxt tresjs https://github.com/user-attachments/assets/596c61a6-4cc9-40cd-9994-6a415b4bc684
A clean project with only Nuxt and the Tres.js module is slow, and performance worsens as the project grows.
Reproduction
https://stackblitz.com/edit/nuxt-starter-a3ltqbft?file=app.vue,package.json,nuxt.config.ts
Steps to reproduce
{ "name": "nuxt-app", "private": true, "type": "module", "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare" }, "dependencies": { "@tresjs/core": "^4.3.1", "@tresjs/nuxt": "^3.0.7", "nuxt": "^3.14.1592", "three": "^0.171.0", "vue": "latest", "vue-router": "latest" }, "packageManager": "[email protected]+sha512.88c9c3864450350e65a33587ab801acf946d7c814ed1134da4a924f6df5a2120fd36b46aab68f7cd1d413149112d53c7db3a4136624cfd00ff1846a0c6cef48a" }
System Info
No response
Used Package Manager
pnpm
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] The provided reproduction is a minimal reproducible example of the bug.
For me it only happens whenever I add @types/three. It's extremely annoying
Has anyone had any success in resolving this issue?
I updated @tresjs/nuxt module and it worked for me:
import { addComponent, addImports, addVitePlugin, createResolver, defineNuxtModule, resolvePath } from '@nuxt/kit'
import { templateCompilerOptions } from '@tresjs/core'
import { defu } from 'defu'
import glsl from 'vite-plugin-glsl'
export interface ModuleOptions {
modules: string[]
glsl: boolean
}
export default defineNuxtModule<ModuleOptions>({
meta: {
name: '@tresjs/nuxt',
configKey: 'tres',
compatibility: {
nuxt: '>=3.14.0',
},
},
defaults: {
modules: [],
glsl: false,
},
async setup(options, nuxt) {
const resolver = createResolver(import.meta.url)
nuxt.options.build.transpile.push(/@tresjs/)
addImports([
{
from: '@tresjs/core',
name: 'extend',
as: 'extendTres',
},
{
from: '@tresjs/core',
type: true,
name: 'TresObject',
},
])
nuxt.options.vue.compilerOptions.isCustomElement = templateCompilerOptions.template.compilerOptions.isCustomElement
nuxt.options.vite.resolve = defu(nuxt.options.vite.resolve, {
dedupe: ['three'],
})
nuxt.options.vite.optimizeDeps = defu(nuxt.options.vite.optimizeDeps, {
include: ['three'],
})
if (options.glsl) {
addVitePlugin(glsl())
}
},
})
Hi @jojco, we recently updated the nuxt tresjs-module and the nuxt-starter.
Could you please try it out with the latest nuxt-starter version and let us know if the issue still exists for you? Thanks!
Same thing happens without Nuxt, in just a Vue application, whenever import Tres from '@tresjs/core'; is added. It makes suggestions appear after ~10 seconds after Ctrl + Space pressed. It makes it unusable to work with a project when Tresjs is used.
This is still an issue when using Vue in the npx create-tres command. Is this being worked on?
Same for my Nuxt project.
Hi guys, thanks for reporting your issue. Would anyone of you be so kind to provide a minimal reproduction repository or Stackblitz with the issue in Tres v5?
Thanks upfront! 🙏🏽
Created a simple reproduction repo here using npx create-tres@latest.
If you need more info, just ask and I'll add it to this thread or my repo.
Took a little longer to respond because I had to figure out how to embed video in markdown files (hevc, mkv, gif, blah blah).