TypeError: Cannot read property 'fields' of undefined after migrating from v5 to v8 on forest-express ResourceSerializer when getting fields names

@vince I tried this, before your return, but serialize prototype accept only one argument :

So i tried, before before your return, this code :

    const serializer = new RecordSerializer(Letters)
    const serialized = await serializer.serialize(results.docs)

The result was returned but on browser i saw on pagination “1 OF NAN” so navigation would be impossible

When you asked me to tried, it make me think to try this :

    const serializer: any = new RecordSerializer(Letters)
    const serialized = await serializer.serialize(results.docs, { count: results.total })

And it seems to work.

Is there a bug on serialize prototype declaration ?
Is my last code good and must work ?

1 Like