-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The application can't start after deleting some model, repository, and controllers #3259
Comments
@m98, what's the error you're getting when running |
|
It would be nice to capture the information from Raymond's comment in our documentation. Any volunteers to contribute such changes? |
@bajtos Why the CLI should not do all of these itself? As Angular CLI which handles many different cases itself, and I believe things like |
@m98 Fortunately you can alter the following script in package.json to just that: I don't think clean is always necessary so it's omitted but can easily be added as above. If there is a say a remove model command, obviously it follows a clean would be required maybe? |
Hi , can i take this issue and update the documentation ? |
@godartm yes, please open a PR. Your contribution will be much appreciated. |
Thanks @godartm. I've assigned this issue to you. :) |
I just ran up against this issue, thanks to @raymondfeng for succinctly providing the solution. I like also the suggestion of @dougal83 to add the clean to the build script. I will do that now as I cannot see any downsides, unless there are negatives I'm missing? |
I'm ok to run |
Would it be useful for me to attempt to compose a PR to that effect @raymondfeng? |
OK - I looked through several dozen places and I can't find where the one for the app is generated and therefore where to lodge PR against... sorry. |
@garethhcoleman, the package.json template can be found in https://github.com/strongloop/loopback-next/blob/master/packages/cli/generators/project/templates/package.json.ejs, if this is what you're looking for. |
That's so strange! Thank you @dhmlau - I looked at that file as it seemed like the obvious candidate but then I noticed that it already had the |
@garethhcoleman Sure, feel free to join the Slack org (see #5048); there's a |
May I tackle this one as my first issue ? |
@MattiaPrimavera sure thing, we are looking forward to review your pull request 💪🏻 |
fix build error when manually deleting a model, repository or controller fix loopbackio#3259
fix build error when manually deleting a model, repository or controller fix loopbackio#3259
here a recommendation instead of use |
fix build error when manually deleting a model, repository or controller fix loopbackio#3259 Signed-off-by: Mattia Primavera <[email protected]>
add rebuild script to more concisely express "clean && build" procedure & remove code duplication fix loopbackio#3259 Signed-off-by: Mattia Primavera <[email protected]>
add rebuild script to more concisely express "clean && build" procedure & remove code duplication fix loopbackio#3259 Signed-off-by: Mattia Primavera <[email protected]>
Add rebuild npm script in example projects & call it within pretest & prestart scripts fix loopbackio#3259 Signed-off-by: Mattia Primavera <[email protected]>
Keep hooks pre/post implicit calls. This will work with yarn 1.x only fix loopbackio#3259 Signed-off-by: Mattia Primavera <[email protected]>
…or controller - force a clean build in prestart npm script - add rebuild script to more concisely express "clean && build" procedure & remove code duplication fix loopbackio#3259 Signed-off-by: Mattia Primavera <[email protected]>
Add rebuild npm script in example projects & call it within pretest & prestart scripts fix loopbackio#3259 Signed-off-by: Mattia Primavera <[email protected]>
…or controller - force a clean build in prestart npm script - add rebuild script to more concisely express "clean && build" procedure & remove code duplication fix #3259 Signed-off-by: Mattia Primavera <[email protected]>
Add rebuild npm script in example projects & call it within pretest & prestart scripts fix #3259 Signed-off-by: Mattia Primavera <[email protected]>
Steps to reproduce
Generate two model, repository and controllers and build, then delete one of the model, repository, and controllers, and try to build again. In my case, I got an error from the model and repository which I already deleted, and it was trying to access it before the build process was complete
Current Behavior
The application on
npm start
tries to access deleted model or repository after I delete model and repository file, and also its link from index.tsExpected Behavior
An easy way to delete a model, repository, and controllers using CLI to reduce such errors, And also not getting an error on manually deleting files.
Additionally, I tried to delete
dist
directory to rebuild the project, and I was getting an error that it was not able to build the project again without having access todist
directory which sounds odd if you compare it with other frameworks whichdist
is in.gitignore
because it's only useful for build purposes.Additional information
Windows 10
'win32', 'x64', '10.16.0'
Acceptance criteria
Modify the project template files
package.json.ejs
andpackage.plain.json.ejs
to runnpm run clean
as part of theprestart
script.🎆 Hacktoberfest 2020
Greetings 👋 to all Hacktoberfest 2020 participants!
Here are few tips 👀 to make your start easier, see also #6456:
#loopback-contributors
channel, you can join our Slack workspace here.The text was updated successfully, but these errors were encountered: