-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Too broad warning on missing package.json while feature initialization #628
Comments
mhm this is strange. Are you sure you can reproduce this error? I tried and I can not and also looking at the code it does not make sense. There were no changes on the plugin logic in those versions (0.11.3...0.11.5) |
Ok now I am understanding. So this is not a bug (the specification of this ticket is not correct that would be rather a feature request to improve on the logging). I first thought you would have run into a bug and db-migrate is not working anymore, but that is not the case. It displays the error to you, you should have got before. And in this case this error most certainly means, there is no package.json in your current working directory. Indeed, the only thing added is a log, when something wents wrong with the plugin initialization. Which can be improved since it is not handling the issue but just logging the error. Line 58 in 108087d
Relabling it for refactoring Please try in the future to be more specific and provide enough information and choose a more useful title for the issue. |
There is in fact a package.json in that folder as well as our "migrations" folder. Upgrading to db-migrate@ 0.11.5 and then running You're saying a package.json is required?
Is there something db-migrate is looking for in the package.json? |
No it is not required and neither it should crash. Actually it can't crash, so I guess you misinterpreted it. Lines 64 to 68 in 9334ee2
As you can see the whole plugin block is encapsulated in a try catch block, and log warn does really only print a warning. nothing more. |
It crashes here: plugins = Object.assign(plugins.dependencies, plugins.devDependencies); I guess the issue would be to see why it's getting in this code anyway, with no plugins defined and why the try/catch appears to not be working. |
In this code:
and the reason it's looking for for plugins is
to be true[ |
db-migrate does not crash. It just prints a warning.
You can see the exit code, and notice that further functionality is being executed. So the try catch just works as expected. However, taking a look, actually without a package.json it would fail differently. Since in v0.11.5 it still directly reads, without checking for a |
ok, fair enough. For now, I can roll back and use previous version. Thanks for your time. |
Sorry, didn't mean to close. |
no worries, I will close and let you know as soon as that got taken care of. |
Thanks
|
fixes #628 Signed-off-by: Tobias Gurtzick <[email protected]>
0.11.6 now only logs in verbose mode and adds handling for non existent dependency properties. |
Excellent! Look forward to testing. Thanks for your hard work. It's appreciated. |
Works great! |
I'm submitting a...
Current behavior
running
db-migrate up
gives the following error:Expected behavior
no error
Minimal reproduction of the problem with instructions
The migrations are SQL format.
database.json
Environment
The text was updated successfully, but these errors were encountered: