Cannot update a component (`PlasmicSelect`) while rendering a different component (`$82d7e5349645de74$var$SelectInner`).

My project uses codegen with next.js (app dir). I updated the Select component from Plasmic Studio to change its styling, but didn’t change anything regarding its functionality or data. Whenever I try to render the Select component in my react project, I get this error:

Cannot update a component (`PlasmicSelect`) while rendering a different component (`$82d7e5349645de74$var$SelectInner`).

The error appears regardless of where I render it, or what props I pass.

Steps to reproduce:

  1. Open Command Prompt on Windows 10 and run $ npx create-plasmic-app@latest
  2. Use the default project name
  3. Choose next.js
  4. Choose Typescript
  5. Choose codegen
  6. Create a new Plasmic Studio project and choose the first blank template
  7. Hit the plus icon and drag in a new Select component
  8. Copy the url and right click inside the Command Prompt window to paste it when prompted
  9. Open the new project with VS Code
  10. Open a new terminal inside VS Code
  11. Run $ npm run dev
  12. Open the indicated localhost link in your browser
  13. Open the browser console to see the error

The error also prints if you render the Select component programmatically rather than through Studio.
The error does NOT print if you preview the current artboard instead of running a dev server.
The error only prints on first mount or page refresh, not on later mounts of the same component.

Looking this error up online, the only related results are completely separate from Plasmic, and it’s usually caused by trying to call setState from outside useEffect. As this error occurs even when I didn’t write any react code, these solutions didn’t help.

Through my own trial and error, I tried:

  1. Turning off strict mode
  2. (Through code) Passing every prop as undefined
  3. (Through code) Passing state values to value and onChange, and rendering MenuItems to the Items slot
  4. (Through code) Passing undefined to value and instead passing to defaultSelectedKey, and rendering MenuItems to the Items slot
  5. (Through Studio) Adding a new prop to Select of type text and dynamically assigning it to Initial Selected Item, then (through code) rendering a MenuItem with a matching value to the Items slot
  6. (Through code) Conditionally rendering the select component with state, and updating said state with useEffect to ensure everything is loaded before it
  7. (Through code) Passing no props
  8. Deleting node_modules and package-lock.json, then running $ npm install

Relevant links:

  • Project - This leads to the component where I originally rendered the Select component.

Hello @juliana_nielson We have identified the issue and are working on a fix.

1 Like

This should be fixed in @plasmicpkgs/react-aria@0.0.154.

1 Like

It works! Thank you so much!