json-server
                                
                                 json-server copied to clipboard
                                
                                    json-server copied to clipboard
                            
                            
                            
                        Error: Type of "lastModified" (number) is not supported. Use objects or arrays of objects.
Hi all, I followed the steps but I get this message:

Any ideas what might be wrong ?
Thanks.
same issue !! did you solved the issue ??

No! I also didn’t get a response.
From: Mohamed Rifkan @.> Sent: Monday, February 20, 2023 5:03 PM To: typicode/json-server @.> Cc: Dimitris Krallis @.>; Author @.> Subject: Re: [typicode/json-server] Error: Type of "lastModified" (number) is not supported. Use objects or arrays of objects. (Issue #1400)
same issue !! did you solved the issue ?? [Screenshot from 2023-02-20 21-31-55]https://user-images.githubusercontent.com/59793466/220153738-a28f7973-aa14-4cdd-a273-149a7966d6a9.png
— Reply to this email directly, view it on GitHubhttps://github.com/typicode/json-server/issues/1400#issuecomment-1437242775, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOIZKMAJPMDAYFRA6WJTGMDWYOISBANCNFSM6AAAAAAUFO35Q4. You are receiving this because you authored the thread.Message ID: @.@.>>
One could possibly help diagnose if you attached your db.json to the issue
Hi @jdk1900 ,
Thank you for reaching out. It appears that you're encountering an issue where JSON Server is not recognizing a field with a numeric value (lastModified) as valid data. This is likely because JSON Server expects data to be structured as objects or arrays of objects. Standalone primitive data types like numbers or strings directly under the root are not supported by default.
To resolve this, you can encapsulate your lastModified field within an object. For example, instead of having: { "lastModified": 123456789 } You should structure your db.json like this: { "info": { "lastModified": 123456789 } } This way, lastModified becomes a property of an object, which is compatible with JSON Server's expected data format. If lastModified is meant to be a global property, you could name the enclosing object something like metadata or info.