Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Transformer is not a function #21

Closed
thau0x01 opened this issue Oct 16, 2018 · 3 comments
Closed

Error: Transformer is not a function #21

thau0x01 opened this issue Oct 16, 2018 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@thau0x01
Copy link
Contributor

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

@thau0x01
Copy link
Contributor Author

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.

@rhwilr
Copy link
Owner

rhwilr commented Oct 16, 2018

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.

@rhwilr rhwilr reopened this Oct 16, 2018
@rhwilr rhwilr added enhancement New feature or request good first issue Good for newcomers labels Oct 16, 2018
@rhwilr
Copy link
Owner

rhwilr commented Oct 17, 2018

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

@rhwilr rhwilr closed this as completed Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants