-
Notifications
You must be signed in to change notification settings - Fork 54
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
gen.utils.js uses require("mongoose") instead of the mongoose from Fawn.init #46
Labels
Comments
Oh yeah. I added getCollection (the only function in the file which needs the user's version of mongoose) to gen.utils on the last release and forgot to change the mongoose source. Good catch. Feel free to open a PR |
jake-billings
added a commit
to jake-billings/Fawn
that referenced
this issue
Jan 25, 2018
…goose from Fawn.init; move all functions that depend on mongoose from gen utils to db utils; update all references accordingly
This was referenced Jan 25, 2018
Pull request sent. See issue #48.
From: Emmanuel Olaojo <[email protected]>
Reply-To: e-oj/Fawn <[email protected]>
Date: Wednesday, January 24, 2018 at 5:09 PM
To: e-oj/Fawn <[email protected]>
Cc: Jake Billings <[email protected]>, Author <[email protected]>
Subject: Re: [e-oj/Fawn] gen.utils.js uses require("mongoose") instead of the mongoose from Fawn.init (#46)
Oh yeah. I added getCollection, the only function in the file which needs mongoose, to gen.utils on the last release and forgot to change to mongoose source. Good catch. Feel free to open a PR
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Open the pr on dev and I'll merge it. Solid work 👌 |
e-oj
added a commit
that referenced
this issue
Jan 25, 2018
Fix #46: gen.utils.js uses require("mongoose") instead of the mongoos…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not super familiar with the structure of this repository. I'll create a pull request if I find some free time and you guys agree with me.
I've had a lot of trouble getting Fawn to work because in some places it uses the statement "require("mongoose")"
By default, npm does not install the same version of mongoose as Fawn. As a result, an additional copy of mongoose is cloned into node_modules/fawn/node_modules/mongoose.
When fawn calls "require("mongoose")" node loads this separate instance of mongoose. As a result, none of the mongoose models I have defined are registered. This results in errors when I try to run transactions.
My current workaround is to manually check the version of mongoose Fawn uses (4.11.3) and lock my project to the same one. This is not ideal for my dev environment, but it does work.
I believe that using the copy of mongoose from Fawn.init throughout the entirety of Fawn would fix this issue.
gen.utils.js is the source of the error I encountered, and the file uses require() to load mongoose. I haven't checked if require() is used to load mongoose anywhere else.
The text was updated successfully, but these errors were encountered: