-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adapters directory being passed to include-all breaks on v0.12.7 and above #3884
Comments
@richdunajewski Thanks for taking the time to write up a detailed report. I think, like you suggested, that the additional error checking added to include-all, combined with the fact that it's doing a recursive lookup, is what is causing the issue here. I'll look into it this evening. If, in the mean time, you could post your installed version of sails-hook-orm (a dependency of Sails) that'll help narrow it down. Thanks! |
@richdunajewski Thanks again for posting the link to the other issue. Talked about this with @sgress454 and he's working on a repro. In the mean time, just to recap what we came up with for future reference:
|
[fixes #3884] (or begins to anyway) - explicitly handle folder-style adapters
@richdunajewski Alright, this should be addressed in the latest code. With the latest updates, I'm not sure your app will lift without any changes, because it seems likely that you were organizing your custom adapters in a way we never intended to support (the documentation on custom adapters was admittedly thin, and @mikermcneil is working on it as we speak). The way it works now (and how it was always intended) was that for a custom adapter "Xyz", you can either:
So you may have to update your folder structure / filenames slightly to account for this. But the |
Thanks @mikermcneil and @sgress454 for the quick attention on this. I've installed Sails from master, and the error about crossAdapter is now gone, however there's now just a simple ORM failed to load error.
I then changed Aside: Is there a clearer way to see what causes the ORM error under the covers? I find it difficult to troubleshoot ORM errors in general, particularly when there are many different connections in use. It's hard to tell which connection is the culprit. Just to clarify on my folder structure under I'll continue to troubleshoot what's going on internal to Sails and report back if I find anything interesting. |
Ah, the curse of posting publicly. Immediately after posting the above I found the culprit for the ORM error. I had another adapter (not pictured) that was written by us rather than installed from npm, that still followed the It looks like the change by @sgress454 is working beautifully. Thank you both! |
Best I can suggest there right now is using |
@sgress454 did you already take care of 4495a16 on master, or should I rebase it? |
@mikermcneil Took care of it on master, but 0.12 still needs to be published |
Published! 0.12.10 |
Sails version: 0.12.7+
Node version: 4.5.0
NPM version: 3.10.5
Operating system: Windows and Linux
We have a customized version of sails-mongo and sails-postgresql in our api/adapters directory. After upgrading to Sails v0.12.7 and above, we get the following error:
After searching through the code, we do indeed find crossAdapter is referenced in each of the custom adapters. The below issue and subsequent fix that was made to v0.12.7 is what broke for us. I suspect that the include-all is being run on the entire api directory, which is causing the node_modules within each adapter to be included. When a collision is detected in crossAdapter.js, the error message is thrown.
If that's truly the case, it seems to me that Sails should exclude api/adapters from include-all as there should never be configuration files here, only adapters.
Please see #3846
The text was updated successfully, but these errors were encountered: