Using @swc-react/* packages with bolt-uxp
Opened this issue · 0 comments
Just wanted to bring this to attention, as the @swc-react looks promising and would be nice to use in a bolt-uxp react project, but using any of the @swc-react packages results in an error:
Uncaught ReferenceError: exports is not defined
Reading up on the main README.md file on this github repo, it is stated that "Recently the Adobe UXP team is moving away from the built-in Spectrum UXP to Spectrum Web Components."
Looking more into using Spectrum Web Components, you would normally add the package, such as "@spectrum-web-components/action-button" to use an action button.
Without defining a definition in the globals.d.ts, typescript will of course complain. But having a premade typed definition for specific components is really nice to have.
It looks like Adobe has created nice wrappers for each of these spectrum components (has supposably has support for Next.js). The documentation page can be found over here -> https://opensource.adobe.com/spectrum-web-components/using-swc-react/
However stated at the beginning, anytime any of the @swc-react packages are imported, it results in the exports is not defined
error.
I could be missing a crucial step that I may have missed, but I haven't found anything clear to resolve this issue.