-
Notifications
You must be signed in to change notification settings - Fork 12
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 registration-helper.ts #9
Comments
Run generate again. There's a bug in the logic, which doesn't create the initializer the first time around. |
I can confirm that running "gulp generate" multiple times did not fix this issue. Here is the output...BTW, the output has the wording "Initializer function "initializer" discovered for entity type: Location" but the generated class for 'Location' does not contain 'initializer'. Also, should the 'initializer' property have been generated as part of the generated model classes (e.g. Location in this case or do you think it needs to be on EntityBase? If latter, could you please provide an updated definition of what EntityBase should look like. I am noting my EntityBase class below.
My EntityBase class is:
|
The initializer is something that you would put into the generated entity and then if it's discovered, it's called by the registration helper. I'm not sure why the generator says it discovered it, but it's not actually there. Here's an example of a generated entity with an initializer. The generator is supposed to add an empty stub the second time around, but it shouldn't generate an invalid registration helper.
I've updated the repo with the tools code from TempHire. It looks like the version here was behind. Try if the updated code works better. It works in the TempHire example. |
@marcelgood I have been using the generator for a while and I had no problems when re-generating after adding column to my table. But ever since I added a code in the I have this code in the Country.ts |
Not sure what would cause that. Can you do the same thing in TempHire and then add a new column/property and see if the same thing happens. Basically if you can give me a repro example, then I can take a look at it. |
After running "gulp generate", I did RegistrationHelper.register in my repository class like so:
but I am getting an error:
Property 'initializer' does not exist on type 'typeof Location'.
The generated registration-helper.ts is below. When watching Brian Noyes' course, I did not see the ".initializer" code....so is it safe to remove this?
The generated Location class does not have initializer property. Here is the generated Location class:
The text was updated successfully, but these errors were encountered: