Skip to content

Using @swc-react/* packages with bolt-uxp #10

@RethinkFlash

Description

@RethinkFlash

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions