0: "Attribute name '-' must match the following regex: /^[A-Za-z][_0-9A-Za-z]*$/"

System Information
  • Strapi Version: 3.6.8
  • Operating System: ubuntu, mac
  • Database: mongodb
  • Node Version: 14.17.6
  • NPM Version: 6.14.15

I migrated from 3.0.0. to 3.6.8 and I am unable to add any new field in an existing collection . Whenever i do that i get this error :
0: “Attribute name ‘-’ must match the following regex: /^[A-Za-z][_0-9A-Za-z]*$/”

How can i avoid this ? or disable this ? I am unable to add any field from UI , I have to manually edit the .json file of that collection.


I had similar problem, but when I deleted //g, regex began to work :slight_smile: so I think regex in Strapi is default as global regex. Because of you delete // and show what it works :slight_smile: