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

Importing kuvio blows up Astro (astro dev) #13

Closed
dearlordylord opened this issue Sep 19, 2024 · 4 comments
Closed

Importing kuvio blows up Astro (astro dev) #13

dearlordylord opened this issue Sep 19, 2024 · 4 comments
Labels

Comments

@dearlordylord
Copy link

dearlordylord commented Sep 19, 2024

I found this issue through using a react component with schemata-ts imported. Although the example is not a real use case, it shows that kuvio can hang Astro setups through being imported as a dependency of another library.

Reproduction: https://github.com/dearlordylord/kuvio-astro-hang

@skeate
Copy link
Owner

skeate commented Sep 19, 2024

Thanks for the reproduction!

It looks like this is because kuvio exports a function called then, and I'm guessing something in the build pipeline expects then to mean it's a Promise. I'm not 100% clear but it looks like it's something in the Node built-ins that's doing this?

It feels pretty ridiculous that this is a problem. Thanks, designers of Promises!

I can rename the function, though then is used all over the place so it's going to be a breaking change. I'll also send a patch to schemata-ts

@skeate skeate closed this as completed in 1c1e8f0 Sep 19, 2024
Copy link

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dearlordylord
Copy link
Author

dearlordylord commented Sep 19, 2024

@skeate thanks for checking this! .then issue is funny indeed, I wonder if it's Astro bug actually

I re-checked Schemata itself (without explicit kuvio import) just to be sure: it seems it doesn't hang the page. Schemata uses kuvio in definitions though so explicit import kuvio is unavoidable sometimes

@skeate
Copy link
Owner

skeate commented Sep 20, 2024

You should be able to upgrade schemata-ts to 2.2.5 now to fix this

https://github.com/jacob-alford/schemata-ts/releases/tag/2.2.5

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

No branches or pull requests

2 participants