Closed nikitavoloboev closed 2 years ago
Hi Nikita - this is happening because loaders are exported with ESM syntax to allow for tree-shaking, and Next doesn't transpile imported modules by default. Try https://www.npmjs.com/package/next-transpile-modules. There's more detail here as well: https://stackoverflow.com/a/65939797
Let me know if that works for you!
That worked, thank you ♥️
Glad to hear it! I should probably put a note in the docs. Thanks for bringing that up!
It would also be great if you can add TS types to the package if you get time. I have to // @ts-ignore
the import. Not critical but would be nice. 😺
Ah yea of course. I'll absolutely add types. I hate having to // ignore
things
@nikitavoloboev Types added with v1.2.3
@nikitavoloboev With v1.2.6 using next-transpile-modules
should no longer be necessary as long as you're using Next 12+ — give it a try if you don't mind, and let me know if it's working for you!
Amazing, thanks a lot for adding it!
Just tested it without transpile and it worked. 🎊
I only imported it with
import { Ring } from "@uiball/loaders"
and then tried to use it. I get this error though:Any idea what might cause it?