Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript compiler error for refs with tresjs #301

Closed
5 tasks done
LBR474 opened this issue Jun 14, 2023 · 2 comments · Fixed by #344
Closed
5 tasks done

Typescript compiler error for refs with tresjs #301

LBR474 opened this issue Jun 14, 2023 · 2 comments · Fixed by #344
Labels
bug Something isn't working dx good first issue Good for newcomers help wanted Extra attention is needed types

Comments

@LBR474
Copy link

LBR474 commented Jun 14, 2023

Describe the bug

I am using tresjs and would like to reference my newly loaded .glb and a directional light.
I should say, the page actually functions as expected, however the red squiggly line appears in my local VSCode with an error, and so would like to nail it down if possible.

Final note: this typescript compiler error only occurs on my local VSCode system, as can be seen from the StackBlitz link below, it doesn't occur there.
So I'm not sure if this is even a bug, but I'd like to ask for help to remove the red squiggly line from my local system, thanks if possible.

Reproduction

https://stackblitz.com/edit/vitejs-vite-qn7w4v

Steps to reproduce

I've tried changing the type of ref to a few things, eg: <THREE.DirectionalLight>, however nothing seems to remove this error:

(property) ref?: ((Ref<THREE.DirectionalLight> | Readonly<Ref<THREE.DirectionalLight>>) & VNodeRef) | undefined

System Info

Here is my package.json for that project:

{
  "name": "tresjs_1",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vue-tsc && vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "@tresjs/cientos": "^2.1.3",
    "@tresjs/core": "^2.1.2",
    
    "three": "^0.153.0",
    "three-stdlib": "^2.23.9",
    "vue": "^3.2.47"
  },
  "devDependencies": {
    
    "@types/three": "^0.152.1",
    "@vitejs/plugin-vue": "^4.1.0",
    "typescript": "^5.0.2",
    "vite": "^4.3.9",
    "vue-tsc": "^1.4.2"
  }
}

Used Package Manager

npm

Code of Conduct

@alvarosabu alvarosabu added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed dx types labels Jun 16, 2023
@lausuarez02
Copy link

Hey @alvarosabu,
Would like to take this issue if you let me.
Cheers.

@alvarosabu
Copy link
Member

@lausuarez02 sure thing, PR welcome 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dx good first issue Good for newcomers help wanted Extra attention is needed types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants