Skip to content
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

seems to be an issue with lodash in knex dependencies #10

Open
kuanb opened this issue Jan 20, 2016 · 2 comments
Open

seems to be an issue with lodash in knex dependencies #10

kuanb opened this issue Jan 20, 2016 · 2 comments

Comments

@kuanb
Copy link
Member

kuanb commented Jan 20, 2016

$ DATABASE_URL=127.0.0.1:5432 node utils/createQueuedTable.js
at createTable 127.0.0.1:5432
/Users/kuanbutts/Documents/cfa/courtbot/node_modules/knex/node_modules/lodash/lodash.js:8878
throw new TypeError(FUNC_ERROR_TEXT);
^

TypeError: Expected a function
at Function.rest (/Users/kuanbutts/Documents/cfa/courtbot/node_modules/knex/node_modules/lodash/lodash.js:8878:15)
at Object.knex.schema.(anonymous function) as createTable
at createTable (/Users/kuanbutts/Documents/cfa/courtbot/utils/createQueuedTable.js:11:22)
at Object. (/Users/kuanbutts/Documents/cfa/courtbot/utils/createQueuedTable.js:25:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)

@kuanb
Copy link
Member Author

kuanb commented Jan 20, 2016

Problem coming from knex.js loc 78: return SchemaInterface[key].apply(schemaBuilder, _.rest(arguments));

arguments is an object instead of a function in this situation and _.rest() is expecting a function. in this situation, it appears perhaps there is something happening wrt use of a Promise? Logging the arguments var shows { '0': 'queued', '1': [Function] }... So the item is queued perhaps but the thing it is looking for is perhaps arg[1]?

@kuanb
Copy link
Member Author

kuanb commented Jan 20, 2016

Wondering if this has anything to do with knex requiring >= older version of lodash and the newer version of lodash just not playing nice with knex. updating knex revealed: Knex:warning - knex.initialize is deprecated, pass your config object directly to the knex module

Next step will be to perhaps replace the initialize tool?

Although that might be its own bag of worms... Looks like the tool used for Courtbot is not even a version listed in the docs at this pt (0.5 when they start at 0.6... !!!)

Upgrading
– 0.8.x -> 0.9
– 0.7.x -> 0.8
– 0.6.x -> 0.7

Also looks like the version of knex used lists as a dependency "lodash": ">=2.4.0", which means that its dl the new lodash, hence all the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant