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

Error when using empty TresCanvas #815

Open
5 tasks done
franciscohermida opened this issue Sep 4, 2024 · 3 comments
Open
5 tasks done

Error when using empty TresCanvas #815

franciscohermida opened this issue Sep 4, 2024 · 3 comments
Labels
good first issue Good for newcomers has-workaround help wanted Extra attention is needed p2-edge-case Bug, but has a workaround or limited in scope (priority) PR welcome

Comments

@franciscohermida
Copy link

franciscohermida commented Sep 4, 2024

Describe the bug

Using <TresCanvas></TresCanvas> will cause errors:
Uncaught TypeError: l.default is not a function

Reproduction

https://stackblitz.com/edit/tresjs-basic-is86dt?file=src%2FApp.vue

Steps to reproduce

Open reproduction link
Check console

System Info

No response

Used Package Manager

npm

Code of Conduct

@franciscohermida
Copy link
Author

franciscohermida commented Sep 4, 2024

The reason I have an empty TresCanvas is because I'm transitioning to use Tres in my project where previously I had my own custom implementation.

As a work around I'm just adding a non visible TresMesh in the default slot (or any other element would probably work)

@alvarosabu
Copy link
Member

Hi @franciscohermida what is your expectation for the behavior? Why is it considered a bug?

@franciscohermida
Copy link
Author

franciscohermida commented Sep 6, 2024

  • For it to work like in previous versions without throwing an error.
  • Not break the app with the error
  • Initialize the TresCanvas creating a canvas element with resizing logic, props to configure many things even if the default slot is empty.
  • Not requiring a workaround like adding a random element in the default slot for it to work.

Maybe I'm doing something really wrong, even though it is a one line of code loading the TresCanvas. I can live with the workaround if this is not considered a bug.

@alvarosabu alvarosabu added help wanted Extra attention is needed p2-edge-case Bug, but has a workaround or limited in scope (priority) has-workaround PR welcome good first issue Good for newcomers labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers has-workaround help wanted Extra attention is needed p2-edge-case Bug, but has a workaround or limited in scope (priority) PR welcome
Projects
None yet
Development

No branches or pull requests

2 participants