Closed richardjli closed 8 years ago
Please make sure that you've installed Knex v0.10.0 as a peer dependency: npm i knex
I have just checked the code again, and realized that Array.prototype.includes()
might cause the problem: https://npmcdn.com/knex-orm@1.0.1/lib/config.js
Please try running your project again, but with babel-plugin-array-includes enabled.
It seems that babel-plugin-transform-runtime needs to be used as a dev dependency for knex-orm in order to transform static ES6 methods. Instance methods (like Array.includes) will probably be replaced by their ES5 equivalents.
Thank you for reporting! I didn't notice this issue because I am currently using babel-node to run tests. That behavior will probably be changed very soon...
Using node v5, babel as transpiler I get the following error.
As soon as I import using
const KnexOrm = require('knex-orm');
orimport KnexOrm from 'knex-orm'
I see the following
node_modules/knex-orm/src/config.js:12 KNEX_ALLOWED_QUERY_METHODS: knexDefaultMethods.filter((item) => ^ TypeError: KNEX_IGNORED_QUERY_METHODS.includes is not a function at /Users/RL/Documents/projects/d/node_modules/knex-orm/src/config.js:13:33 at Array.filter (native) at Object.<anonymous> (/Users/RL/Documents/projects/d/node_modules/knex-orm/src/config.js:12:50) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at Object.<anonymous> (/Users/RL/Documents/projects/d/node_modules/knex-orm/src/query-builder.js:1:1) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32)