Error Adding @swc-uxp-wrappers/action-group to SWC UXP React Plugin

,

So, I recently started making my first plugin in react using swc-uxp-react-starter from GitHub,template, and everything worked well until I added @swc-uxp-wrappers/action-group Now, I’m encountering the following error during the build:

Here are my dependencies and resolutions in package.json:

Dependencies:

"dependencies": {
    "@spectrum-web-components/icon": "0.49.0",
    "@swc-react/action-button": "0.37.0",
    "@swc-react/action-group": "0.37.0",
    "@swc-react/divider": "0.37.0",
    "@swc-react/theme": "0.14.8-react.2993",
    "@swc-uxp-wrappers/action-button": "^2.0.0",
    "@swc-uxp-wrappers/action-group": "^2.0.0",
    "@swc-uxp-wrappers/button": "^2.0.0",
    "@swc-uxp-wrappers/divider": "^2.0.0",
    "@swc-uxp-wrappers/utils": "2.0.1",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-scripts": "^5.0.1",
    "sass": "^1.80.4"
  },

Resolution:

"resolutions": {
    "@swc-react/menu": "0.16.9-react.3029",
    "@swc-react/action-bar": "0.5.9-react.2993",
    "@swc-react/action-button": "0.37.0",
    "@swc-react/action-group": "0.37.0",
    "@swc-react/avatar": "0.31.0",
    "@swc-react/banner": "0.9.5-react.3120",
    "@swc-react/button": "0.19.8-react.3029+c59ca07be",
    "@swc-react/button-group": "0.10.6-react.3163",
    "@swc-react/card": "0.13.4-react.2993",
    "@swc-react/checkbox": "0.14.6-react.2993",
    "@swc-react/dialog": "0.11.12",
    "@swc-react/divider": "0.37.0",
    "@swc-react/field-group": "0.8.3-react.3120",
    "@swc-react/field-label": "0.10.3-react.3029",
    "@swc-react/help-text": "0.2.7-react.2993",
    "@spectrum-web-components/icons-ui": "0.9.5",
    "@spectrum-web-components/icons-workflow": "0.9.5",
    "@swc-react/illustrated-message": "0.9.8-react.2993",
    "@swc-react/link": "0.14.1-react.3029",
    "@swc-react/picker-button": "0.1.4-react.2993",
    "@swc-react/popover": "0.12.13",
    "@swc-react/radio": "0.11.7-react.2993",
    "@swc-react/sidenav": "0.13.6-react.3029",
    "@swc-react/switch": "0.11.5-react.2993",
    "@swc-react/table": "0.1.10",
    "@swc-react/tags": "0.10.3-react.3120",
    "@swc-react/textfield": "0.13.11-react.3163",
    "@swc-react/toast": "0.11.11-react.3163",
    "@swc-react/tooltip": "0.11.13",
    "@spectrum-web-components/shared": "0.15.4",
    "@spectrum-web-components/styles": "0.22.1",
    "@spectrum-web-components/base": "0.7.5",
    "@spectrum-web-components/banner": "0.9.2",
    "@spectrum-web-components/link": "0.14.1",
    "@spectrum-web-components/action-button": "0.8.7",
    "@spectrum-web-components/button": "0.19.8",
    "@spectrum-web-components/divider": "0.5.0",
    "@spectrum-web-components/action-group": "0.12.4",
    "@spectrum-web-components/avatar": "0.10.3",
    "@spectrum-web-components/card": "0.13.4",
    "@spectrum-web-components/field-label": "0.10.3",
    "@spectrum-web-components/illustrated-message": "0.9.8",
    "@spectrum-web-components/checkbox": "0.14.0",
    "@spectrum-web-components/action-bar": "0.5.9",
    "@spectrum-web-components/popover": "0.12.4",
    "@spectrum-web-components/tooltip": "0.11.9",
    "@spectrum-web-components/picker-button": "0.1.4",
    "@spectrum-web-components/menu": "0.16.9",
    "@spectrum-web-components/textfield": "0.13.8",
    "@spectrum-web-components/help-text": "0.2.7",
    "@spectrum-web-components/table": "0.1.7",
    "@spectrum-web-components/theme": "0.14.8",
    "@spectrum-web-components/button-group": "0.10.8",
    "@spectrum-web-components/dialog": "0.11.12",
    "@spectrum-web-components/radio": "0.10.0",
    "@spectrum-web-components/switch": "0.10.0",
    "@spectrum-web-components/sidenav": "0.13.7",
    "@spectrum-web-components/toast": "0.11.9",
    "@spectrum-web-components/tags": "0.10.1"
  }

I’ve attempted various version adjustments for @swc-uxp-wrappers and @swc-uxp-wrappers/utils, but no solution has worked so far. If anyone has experienced this or found a workaround, any guidance would be appreciated!

1 Like

Do you want to target UXP7 or UXP8? It looks like the data for UXP8 is mixed in with the template for UXP7. Also, it looks like yarn and pnpm are mixed up.

In the template for UXP8 that I created based on create-swc-uxp-react-app, @swc-uxp-wrappers/action-group and @swc-react/action-group are working fine.

Hey @EmmaZ
Can you please try using the 0.37.0 for theme ?
@swc-react/theme”: “0.37.0”

Also you may want to use the create-swc-uxp-react-app template for updated and consistent dependancies

Thank you, it was my pnpm that was causing the issue. So I deleted modules folder and installed again using yarn and that fixed it.

2 Likes