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

When TresCanvas is unmounted, an error occurs equal to the number of Html components. #587

Open
5 tasks done
angrymusic opened this issue Jan 14, 2025 · 0 comments
Open
5 tasks done

Comments

@angrymusic
Copy link

Describe the bug

When TresCanvas is unmounted, an error occurs equal to the number of Html components.
hook.js:608 THREE.Material: parameter 'vertexShader' has value of undefined.

<template>
  <div class="about">
    <h1>This is an about page</h1>
    <div class="canvas">
      <TresCanvas v-bind="gl">
        <OrbitControls />
        <TresPerspectiveCamera :position="[5, 5, 5]" />
        <!-- Your scene here -->
        <TresMesh cast-shadow :position="[0, 0, 0]">
          <TresBoxGeometry :args="[1, 1, 2]" />
          <TresMeshToonMaterial color="blue" />
          <Html center transform sprite>
            <div class="text">TEXT</div>
          </Html>
        </TresMesh>
      </TresCanvas>
    </div>
  </div>
</template>
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { Html, OrbitControls } from '@tresjs/cientos'
const gl = {
  clearColor: '#87CEEB',
  shadows: true,
  alpha: true,
  shadowMapType: BasicShadowMap,
  outputColorSpace: SRGBColorSpace,
  toneMapping: NoToneMapping,
}
</script>
<style>
.canvas {
  width: 500px;
  height: 500px;
  position: relative;
}
.text {
  color: white;
  font-weight: bold;
  font-size: 30px;
}
</style>


hook.js:608 THREE.Material: parameter 'vertexShader' has value of undefined.

now about page
스크린샷 2025-01-14 161928

if I go home?
스크린샷 2025-01-14 161935
If I add Html components, the error increases by the corresponding number.

Reproduction

https://stackblitz.com/edit/tresjs-basic-4pso7hpr?file=src%2Fcomponents%2FTheExperience.vue

Steps to reproduce

No response

System Info

npx envinfo --system --npmPackages '{vite,@tresjs/*, three, vue}' --binaries --browsers
Need to install the following packages:
[email protected]
Ok to proceed? (y) y


  System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (8) x64 13th Gen Intel(R) Core(TM) i7-1355U
    Memory: 1.70 GB / 7.76 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 11.0.0 - ~/.nvm/versions/node/v20.18.0/bin/npm
  npmPackages:
    @tresjs/cientos: ^4.0.3 => 4.0.3 
    @tresjs/core: ^4.3.2 => 4.3.2 
    vite: ~6.0.6 => 6.0.6

Used Package Manager

npm

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant