I get `TypeError: Cannot create property 'id' on string 'role-1'` when use array of strings for an endpoint
Author: peshoicovCreated Feb 20, 2026Updated May 24, 2026
The JSON is like so:
{ "roles": ['role-1', 'role-2']}
But when I try to run json-server on such json I get:
TypeError: Cannot create property 'id' on string 'role-1'
Any way to overcome this?
Source: typicode/json-server