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

Can't load shaders #13

Closed
AndresDiaz1 opened this issue Jun 30, 2022 · 4 comments
Closed

Can't load shaders #13

AndresDiaz1 opened this issue Jun 30, 2022 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AndresDiaz1
Copy link

Hi

I follow the readme, but it throws this error: [vite] Internal server error: shaderChunks.at is not a function

I had to do this workaround on loadShaders.js library file.:

I had to replace:
const caller = shaderChunks.at(-1);
to
const caller = shaderChunks[shaderChunks.length-1]

Have you faced the same error?

@UstymUkhman
Copy link
Owner

Hi @AndresDiaz1 , thanks for reporting this issue. I haven't face the same error, but my guess this is happening due to your Node.js version. Array.at was introduced in v16.6.0 so most likely this issue is because you're running a node environment prior to that. Anyway, I will update that line to use a more classic approach with .length - 1 in order to support older node environments. For now you can use v0.1.2 to avoid this hack.

@UstymUkhman UstymUkhman self-assigned this Jul 1, 2022
@UstymUkhman UstymUkhman added the bug Something isn't working label Jul 1, 2022
@UstymUkhman UstymUkhman added this to the Release #10 milestone Jul 1, 2022
@UstymUkhman
Copy link
Owner

@AndresDiaz1 I'm closing this since version 0.2.0 should fix your issue. Feel free to open a new one if you notice some other problems. Also, please consider giving a ⭐ to this project if you've found it useful, thanks!

@AndresDiaz1
Copy link
Author

Thanks for the quick response!
Yes, you're right it was the node version. I was using version 14.8.0 once I upgraded it above 16 it worked.
Also using version 14.8.0 of node and the new version 0.2.0 works perfectly.

Thanks for your help 👍

@UstymUkhman
Copy link
Owner

Nice! I'm glad to help and thanks for the star. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants