Skip to main content
Question

Help needed for a widget. Invalid syncedState value

  • July 14, 2023
  • 5 replies
  • 269 views

Corey_O_Brien

I can use my widget just fine, both in dev and in prod, but when other people try to drag it onto a canvas they get the following error.

Error: in setSyncedState: Invalid syncedState value for widgetID=1255306792807530830 name=name value=undefined
at (PLUGIN_5_SOURCE:260)

Why does this work for me but not other people and what can I do to fix it? Any help would be appreciated.

This topic has been closed for replies.

5 replies

tank666
  • July 14, 2023

Check line 260 of your widget.


Corey_O_Brien
  • Author
  • Active Member
  • July 14, 2023

I found the problem but haven’t fixed it yet. I was doing this “figma.currentUser.name.split(/\s*,\s*/)[1]” which worked for my name but not for others. it is assuming the format of people’s names and not all names match the format of mine.


Corey_O_Brien
  • Author
  • Active Member
  • July 14, 2023

Yea was doing it but it really didn’t have to do with line 260 🙂


tank666
  • July 14, 2023

You probably checked this line in the .tsx file, but you should have done it in the compiled .js file.


Corey_O_Brien
  • Author
  • Active Member
  • July 14, 2023

Possibly :P. It did give enough info to start troubleshooting though. I was using the second value after splitting up the string. Some people don’t have a comma separated name so their name didn’t have a second value after the split. I needed more conditional in there or in my case I just took out the split for now and used the whole username.