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
Lodash global template settings #2281
Comments
We just use the one we install via NPM. I assume it's isolated to that install. |
Well, not exactly. I'm using the same version of lodash in my project alongside Sequelize which is what ends up populating |
Not sure we can do anything about that then. If lodash is somehow sharing anything between seperate installs it's kind of hard to do anything about that (i don't see why they would code it like that). Even if you are using the same version, unless you are taking it from Sequelize they should be installed in two seperate places in NPM i believe. In any case i'm not sure how we can use a seperate lodash object anymore than we already are. |
But can't we override the defaults by always passing an options object? |
@janmeier yeah i suppose we could. |
To test this you can create a project that depends on both lodash and Sequelize. After npm install you'll notice that |
@janmeier @mickhansen This has nothing to do with sequelize and it would be best to fix the issue in the library that alters the the function. So I would close this issue. |
I got burned a few days ago while trying to do a
sync()
on my database and getting the errorSyntaxError: Unexpected token =
originating within lodash's.template
function. It turns out and some other module in my project is altering lodash's globaltemplateSettings.interpolate
value and since Sequelize is utilizing the global lodash object it was wasn't able to parse templates with the default interpolate regex. I know this is the other library's fault at the end of the day but wouldn't it make sense within Sequelize to either pass default options to each call of.template(text, data, [options])
or perhaps instantiate a separate lodash object toUtil._
instead of using the global singleton?The text was updated successfully, but these errors were encountered: