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 in created hook: "TypeError: Class constructor Model cannot be invoked without 'new'" #75

Closed
ConsoleTVs opened this issue Mar 14, 2020 · 3 comments

Comments

@ConsoleTVs
Copy link

image

When I get a model and I type:

Model.get(), this is thrown.

Eg: Product.get()

@xyng
Copy link

xyng commented Mar 22, 2020

I just encountered this issue too. Seems like it's not an actual bug in the library, but a misconfiguration of your build-system.
For me, it was my Typescript-Compiler being set to es5, despite it's output being passed to babel later on (for ... reasons).
Setting it to es6 or esnext solves that problem.

See this similar issue in sequelize for more info and possible solutions

@ConsoleTVs
Copy link
Author

I want to use this for my front-end, and seems I am unable to compile it correctly. I had to run it with babel to run it. And yet it's still missleading

@DavidDuwaer
Copy link
Owner

DavidDuwaer commented Mar 23, 2020

This issue has been noted before: #54. ConsoleTVs, which part of the readme/description/documentation is misleading, or is it just that it may be incomplete? Please answer in the other issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants