rhwilr/adonis-bumblebee

Error: Transformer is not a function

Closed this issue · 3 comments

is the first time i use this package, can you help me?

I'm getting this error when sending a request to the endpoint that uses the transform method.

captura de tela 2018-10-16 as 12 42 23

I'm a dumb, just ignore it, i forgot to export the ModelTransformer in my custom transformer.

module.exports = ModelTransformer

My code was missing this line.

I'm glad you could solve the issue.
But I do think the error message could have been clearer, so I will leave this issue open to remind me to provide a better error message.

In version 1.5.0, the error message now says that the transformer is not valid:
A transformer must be a function or a class extending TransformerAbstract