Vincit / objection.js

An SQL-friendly ORM for Node.js
https://vincit.github.io/objection.js
MIT License
7.24k stars 636 forks source link

BUG: TypeError: Class constructor Ajv cannot be invoked without 'new' #2043

Closed grimen closed 3 years ago

grimen commented 3 years ago

Get this error in Node v14.16.0 when doing insert operation using objection@v2.2.15 when ajv@8 is locked (by other dependencies):

TypeError: Class constructor Ajv cannot be invoked without 'new'
    at Function.init (<root>/node_modules/objection/lib/model/AjvValidator.js:24:28)
    at new Validator (<root>/node_modules/objection/lib/model/Validator.js:5:22)
    at new AjvValidator (<root>/node_modules/objection/lib/model/AjvValidator.js:15:1)
    at Function.createValidator (<root>/node_modules/objection/lib/model/Model.js:341:12)
    at getValidator (<root>/node_modules/objection/lib/model/Model.js:874:21)
    at cachedGet (<root>/node_modules/objection/lib/model/Model.js:867:61)
    at Function.getValidator (<root>/node_modules/objection/lib/model/Model.js:391:12)
    at validate (<root>/node_modules/objection/lib/model/modelValidate.js:26:32)
    at Observation.$validate (<root>/node_modules/objection/lib/model/Model.js:97:12)
    at GraphInsertAction._insert (<root>/node_modules/objection/lib/queryBuilder/graph/insert/GraphInsertAction.js:177:16)
    at GraphInsertAction._insertBatch (<root>/node_modules/objection/lib/queryBuilder/graph/insert/GraphInsertAction.js:48:16)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

When reviewing objection/lib/model/AjvValidator.js:24:28 I see ambiguous JavaScript syntax:

// Create a normal Ajv instance.
self.ajv = new getAjv()( // <-------------------- ISSUE
  Object.assign(
    {
      useDefaults: true,
    },
    self.ajvOptions
  )
);

// Create an instance that doesn't set default values. We need this one
// to validate `patch` objects (objects that have a subset of properties).
self.ajvNoDefaults = new getAjv()( // <-------------------- ISSUE
  Object.assign({}, self.ajvOptions, {
    useDefaults: false,
  })
);

Below is a modified version that never throws this error for me, unambiguous JavaScript syntax:

const AJV = getAjv()

// Create a normal Ajv instance.
self.ajv = new AJV(
  Object.assign(
    {
      useDefaults: true,
    },
    self.ajvOptions
  )
);

// Create an instance that doesn't set default values. We need this one
// to validate `patch` objects (objects that have a subset of properties).
self.ajvNoDefaults = new AJV(
  Object.assign({}, self.ajvOptions, {
    useDefaults: false,
  })
);

My environment for the record:

$ sw_vers
ProductName:    macOS
ProductVersion: 11.2.3
BuildVersion:   20D91

$ node --version     
v14.16.0

$ yarn info objection
yarn info v1.22.10
{
  name: 'objection',
  time: {
    modified: '2021-03-16T11:56:13.837Z',
    created: '2012-06-18T07:43:09.156Z',
    '0.0.1': '2012-06-18T07:43:10.883Z',
    '0.0.3': '2012-07-10T20:40:18.675Z',
    '0.0.4': '2012-07-31T20:22:50.947Z',
    '0.0.5': '2012-07-31T21:28:43.380Z',
    '0.1.5': '2015-08-07T13:09:59.383Z',
    '0.1.6': '2015-08-08T08:41:07.907Z',
    '0.2.0': '2015-08-25T05:43:04.921Z',
    '0.2.1': '2015-08-25T15:07:08.250Z',
    '0.2.2': '2015-09-22T19:17:15.564Z',
    '0.2.3': '2015-09-22T19:24:45.804Z',
    '0.2.4': '2015-09-23T07:10:43.480Z',
    '0.2.5': '2015-09-24T15:44:34.466Z',
    '0.2.6': '2015-09-24T19:38:25.084Z',
    '0.2.7': '2015-09-27T18:38:58.657Z',
    '0.2.8': '2015-11-05T11:41:58.754Z',
    '0.3.0': '2015-11-21T19:42:29.199Z',
    '0.3.1': '2015-12-14T02:19:39.104Z',
    '0.3.2': '2015-12-14T03:11:57.221Z',
    '0.3.3': '2015-12-15T15:50:32.570Z',
    '0.4.0-rc.1': '2015-12-25T17:09:58.833Z',
    '0.4.0-rc.2': '2015-12-29T16:44:29.569Z',
    '0.4.0-rc.3': '2016-01-02T06:34:27.268Z',
    '0.4.0-rc.4': '2016-01-19T10:27:37.825Z',
    '0.4.0': '2016-01-19T11:37:22.807Z',
    '0.5.0-alpha.0': '2016-02-11T12:36:45.620Z',
    '0.5.0-alpha.1': '2016-02-14T11:15:00.249Z',
    '0.5.0-alpha.2': '2016-02-14T15:40:46.210Z',
    '0.5.0-rc.1': '2016-04-03T16:09:11.122Z',
    '0.5.0-rc.2': '2016-05-11T16:01:49.757Z',
    '0.5.0-rc.3': '2016-05-12T18:42:53.932Z',
    '0.5.0-rc.4': '2016-05-20T11:16:22.360Z',
    '0.5.0-rc.5': '2016-05-20T11:18:52.309Z',
    '0.5.0': '2016-06-13T17:08:05.749Z',
    '0.5.1': '2016-06-15T11:35:33.554Z',
    '0.5.2': '2016-06-29T11:10:28.401Z',
    '0.5.3': '2016-07-07T11:35:02.294Z',
    '0.5.4': '2016-07-18T11:33:55.003Z',
    '0.5.5': '2016-07-19T09:36:38.243Z',
    '0.6.0-alpha.1': '2016-08-30T07:21:32.163Z',
    '0.6.0-alpha.2': '2016-09-01T13:10:47.243Z',
    '0.6.0-rc.1': '2016-09-04T09:23:23.620Z',
    '0.6.0-rc.2': '2016-09-08T06:06:21.532Z',
    '0.6.0-rc.3': '2016-09-13T11:14:47.395Z',
    '0.6.0-rc.4': '2016-09-19T20:41:54.674Z',
    '0.6.0-rc.5': '2016-09-20T21:52:38.270Z',
    '0.6.0-rc.6': '2016-10-02T14:05:23.077Z',
    '0.6.0': '2016-10-09T12:43:59.438Z',
    '0.6.1': '2016-10-22T19:22:37.378Z',
    '0.6.2': '2016-11-14T11:21:54.624Z',
    '0.7.0-rc.1': '2016-12-22T06:57:50.315Z',
    '0.7.0-rc.2': '2017-02-03T05:54:12.905Z',
    '0.7.0-rc.3': '2017-02-03T07:43:26.270Z',
    '0.7.0': '2017-03-10T06:36:01.581Z',
    '0.7.1': '2017-03-10T18:29:59.000Z',
    '0.7.2': '2017-03-10T22:03:44.397Z',
    '0.7.3': '2017-03-11T01:11:07.628Z',
    '0.7.4': '2017-03-12T14:12:25.258Z',
    '0.7.5': '2017-03-12T18:20:13.937Z',
    '0.7.6': '2017-03-16T18:32:17.170Z',
    '0.7.7': '2017-03-17T09:32:00.042Z',
    '0.7.8': '2017-03-17T09:58:09.184Z',
    '0.7.9': '2017-03-19T08:42:52.301Z',
    '0.7.10': '2017-03-22T06:49:08.537Z',
    '0.7.11': '2017-03-30T07:15:29.189Z',
    '0.7.12': '2017-04-01T15:52:23.018Z',
    '0.8.0-rc.1': '2017-05-18T10:30:30.118Z',
    '0.8.0-rc.2': '2017-05-23T13:19:37.471Z',
    '0.8.0': '2017-05-23T14:48:24.594Z',
    '0.8.1': '2017-05-26T22:53:23.883Z',
    '0.8.2': '2017-06-08T12:22:10.543Z',
    '0.8.3': '2017-06-11T11:53:20.621Z',
    '0.8.4': '2017-06-28T07:17:08.806Z',
    '0.8.5': '2017-07-19T18:26:47.670Z',
    '0.8.6': '2017-08-04T22:39:03.411Z',
    '0.8.7': '2017-08-14T09:12:27.609Z',
    '0.8.8': '2017-08-24T16:08:09.305Z',
    '0.8.9': '2017-09-03T23:20:04.122Z',
    '0.9.0': '2017-10-31T12:15:23.299Z',
    '0.9.1': '2017-11-19T00:15:33.804Z',
    '0.9.2': '2017-11-20T10:09:59.687Z',
    '0.9.3': '2017-12-21T11:26:48.224Z',
    '0.9.4': '2017-12-24T14:49:17.030Z',
    '1.0.0-rc.1': '2018-01-12T10:09:32.946Z',
    '1.0.0-rc.2': '2018-01-13T17:10:34.039Z',
    '1.0.0-rc.3': '2018-01-19T13:43:58.254Z',
    '1.0.0-rc.4': '2018-01-20T10:43:22.485Z',
    '1.0.0-rc.5': '2018-01-23T00:05:32.812Z',
    '1.0.0-rc.6': '2018-01-26T11:16:26.516Z',
    '1.0.0-rc.7': '2018-01-28T00:26:07.901Z',
    '1.0.0-rc.9': '2018-01-30T15:06:11.948Z',
    '1.0.0-rc.10': '2018-01-30T19:04:16.949Z',
    '1.0.0-rc.11': '2018-02-02T13:06:18.409Z',
    '1.0.0-rc.12': '2018-02-04T19:11:28.361Z',
    '1.0.0-rc.13': '2018-02-10T11:10:50.682Z',
    '1.0.0': '2018-02-14T12:09:02.498Z',
    '1.0.1': '2018-03-23T15:11:41.746Z',
    '1.1.0': '2018-03-31T11:39:16.960Z',
    '1.1.1': '2018-04-03T09:53:00.997Z',
    '1.1.2': '2018-04-05T21:12:50.256Z',
    '1.1.3': '2018-04-06T09:15:49.374Z',
    '1.1.4': '2018-04-10T09:54:12.132Z',
    '1.1.5': '2018-04-13T16:25:00.731Z',
    '1.1.6': '2018-04-15T18:12:45.899Z',
    '1.1.7': '2018-04-17T19:10:22.440Z',
    '1.1.8': '2018-05-09T05:51:31.058Z',
    '1.1.9': '2018-05-11T18:02:58.423Z',
    '1.1.10': '2018-05-31T12:00:20.964Z',
    '1.2.0': '2018-07-17T14:15:16.766Z',
    '1.2.1': '2018-07-24T23:00:58.499Z',
    '1.2.2': '2018-07-27T13:44:31.736Z',
    '1.2.3': '2018-08-23T18:51:34.557Z',
    '1.2.4': '2018-08-27T21:13:37.951Z',
    '1.2.5': '2018-08-27T23:10:02.944Z',
    '1.2.6': '2018-08-28T15:16:33.619Z',
    '1.3.0': '2018-09-20T06:10:43.827Z',
    '1.4.0': '2018-10-24T11:29:25.246Z',
    '1.5.0-rc.1': '2018-12-28T21:16:27.289Z',
    '1.5.0-rc.3': '2019-01-05T21:34:26.302Z',
    '1.5.0-rc.4': '2019-01-07T11:38:41.281Z',
    '1.5.0-rc.5': '2019-01-20T22:12:16.888Z',
    '1.5.0': '2019-01-20T23:20:07.786Z',
    '1.5.1': '2019-01-22T22:24:38.539Z',
    '1.5.2': '2019-01-23T10:12:58.661Z',
    '1.5.3': '2019-01-23T11:47:25.498Z',
    '1.6.0-rc.1': '2019-02-13T11:30:02.291Z',
    '1.6.0': '2019-02-16T11:29:07.824Z',
    '1.6.1': '2019-02-19T14:46:04.587Z',
    '1.6.2': '2019-02-20T09:32:46.464Z',
    '1.6.3': '2019-02-27T09:58:02.912Z',
    '1.6.4': '2019-03-21T14:09:49.811Z',
    '1.6.5': '2019-03-27T07:49:54.354Z',
    '1.6.6': '2019-03-28T14:07:39.380Z',
    '1.6.7': '2019-04-02T11:14:24.122Z',
    '1.6.8': '2019-04-17T19:11:33.928Z',
    '1.6.9': '2019-05-18T12:00:40.543Z',
    '2.0.0-alpha.1': '2019-08-21T12:25:29.072Z',
    '2.0.0-alpha.2': '2019-08-21T12:29:59.692Z',
    '2.0.0-alpha.3': '2019-08-25T16:45:35.248Z',
    '2.0.0-alpha.4': '2019-09-05T08:27:20.859Z',
    '2.0.0-alpha.5': '2019-09-13T08:24:46.356Z',
    '2.0.0-alpha.6': '2019-09-13T09:03:55.016Z',
    '2.0.0-alpha.7': '2019-09-15T09:28:59.712Z',
    '1.6.11': '2019-09-21T11:41:55.049Z',
    '2.0.0-alpha.8': '2019-09-22T22:11:27.549Z',
    '2.0.0-alpha.9': '2019-10-05T09:46:26.691Z',
    '2.0.0-alpha.10': '2019-11-13T18:42:05.557Z',
    '2.0.0-rc.1': '2019-11-18T09:40:03.769Z',
    '2.0.0-rc.2': '2019-11-29T22:23:47.802Z',
    '2.0.0': '2019-11-30T20:01:46.896Z',
    '2.0.1': '2019-12-02T19:02:50.188Z',
    '2.0.2': '2019-12-03T18:07:29.246Z',
    '2.0.3': '2019-12-04T22:31:48.535Z',
    '2.0.4': '2019-12-09T08:01:02.097Z',
    '2.0.5': '2019-12-10T08:56:14.824Z',
    '2.0.6': '2019-12-10T19:28:51.543Z',
    '2.0.7': '2019-12-13T11:45:35.166Z',
    '2.0.8': '2019-12-23T15:38:38.560Z',
    '2.0.10': '2019-12-24T00:28:50.670Z',
    '2.1.0': '2020-01-08T15:56:45.669Z',
    '2.1.1': '2020-01-12T09:50:28.172Z',
    '2.1.2': '2020-01-12T16:01:02.502Z',
    '2.1.3': '2020-02-17T08:26:18.369Z',
    '2.1.4': '2020-05-23T20:12:44.809Z',
    '2.1.5': '2020-05-26T10:47:14.008Z',
    '2.1.6': '2020-06-05T09:56:37.208Z',
    '2.2.0': '2020-06-08T21:59:48.662Z',
    '2.2.1': '2020-07-06T15:03:35.836Z',
    '2.2.2': '2020-07-27T14:09:46.615Z',
    '2.2.3': '2020-08-17T06:57:18.053Z',
    '2.2.4': '2020-12-31T15:50:51.854Z',
    '2.2.5': '2021-01-08T00:24:21.517Z',
    '2.2.6': '2021-01-09T11:44:34.138Z',
    '2.2.7': '2021-01-14T09:45:12.828Z',
    '2.2.8': '2021-01-23T12:38:47.816Z',
    '2.2.9': '2021-01-24T08:13:11.955Z',
    '2.2.10': '2021-01-24T13:19:59.905Z',
    '2.2.11': '2021-01-25T12:59:49.917Z',
    '2.2.12': '2021-01-26T11:56:12.562Z',
    '2.2.13': '2021-01-29T15:39:35.401Z',
    '2.2.14': '2021-01-30T11:38:39.799Z',
    '2.2.15': '2021-03-16T11:56:04.670Z'
  },
  maintainers: [
    {
      name: 'koskimas',
      email: 'koskomi@gmail.com'
    },
    {
      name: 'elhigu',
      email: 'mikael.lepisto@vincit.com'
    }
  ],
  'dist-tags': {
    latest: '2.2.15',
    next: '2.2.15'
  },
  description: 'An SQL-friendly ORM for Node.js',
  versions: [
    '0.1.6',
    '0.2.0',
    '0.2.1',
    '0.2.2',
    '0.2.3',
    '0.2.4',
    '0.2.5',
    '0.2.6',
    '0.2.7',
    '0.2.8',
    '0.3.0',
    '0.3.1',
    '0.3.2',
    '0.3.3',
    '0.4.0-rc.1',
    '0.4.0-rc.2',
    '0.4.0-rc.3',
    '0.4.0-rc.4',
    '0.4.0',
    '0.5.0-alpha.0',
    '0.5.0-alpha.1',
    '0.5.0-alpha.2',
    '0.5.0-rc.1',
    '0.5.0-rc.2',
    '0.5.0-rc.3',
    '0.5.0-rc.4',
    '0.5.0-rc.5',
    '0.5.0',
    '0.5.1',
    '0.5.2',
    '0.5.3',
    '0.5.4',
    '0.5.5',
    '0.6.0-alpha.1',
    '0.6.0-alpha.2',
    '0.6.0-rc.1',
    '0.6.0-rc.2',
    '0.6.0-rc.3',
    '0.6.0-rc.4',
    '0.6.0-rc.5',
    '0.6.0-rc.6',
    '0.6.0',
    '0.6.1',
    '0.6.2',
    '0.7.0-rc.1',
    '0.7.0-rc.2',
    '0.7.0-rc.3',
    '0.7.0',
    '0.7.1',
    '0.7.2',
    '0.7.3',
    '0.7.4',
    '0.7.5',
    '0.7.6',
    '0.7.7',
    '0.7.8',
    '0.7.9',
    '0.7.10',
    '0.7.11',
    '0.7.12',
    '0.8.0-rc.1',
    '0.8.0-rc.2',
    '0.8.0',
    '0.8.1',
    '0.8.2',
    '0.8.3',
    '0.8.4',
    '0.8.5',
    '0.8.6',
    '0.8.7',
    '0.8.8',
    '0.8.9',
    '0.9.0',
    '0.9.1',
    '0.9.2',
    '0.9.3',
    '0.9.4',
    '1.0.0-rc.1',
    '1.0.0-rc.2',
    '1.0.0-rc.3',
    '1.0.0-rc.4',
    '1.0.0-rc.5',
    '1.0.0-rc.6',
    '1.0.0-rc.7',
    '1.0.0-rc.9',
    '1.0.0-rc.10',
    '1.0.0-rc.11',
    '1.0.0-rc.12',
    '1.0.0-rc.13',
    '1.0.0',
    '1.0.1',
    '1.1.0',
    '1.1.1',
    '1.1.2',
    '1.1.3',
    '1.1.4',
    '1.1.5',
    '1.1.6',
    '1.1.7',
    '1.1.8',
    '1.1.9',
    '1.1.10',
    '1.2.0',
    '1.2.1',
    '1.2.2',
    '1.2.3',
    '1.2.4',
    '1.2.5',
    '1.2.6',
    '1.3.0',
    '1.4.0',
    '1.5.0-rc.1',
    '1.5.0-rc.3',
    '1.5.0-rc.4',
    '1.5.0-rc.5',
    '1.5.0',
    '1.5.1',
    '1.5.2',
    '1.5.3',
    '1.6.0-rc.1',
    '1.6.0',
    '1.6.1',
    '1.6.2',
    '1.6.3',
    '1.6.4',
    '1.6.5',
    '1.6.6',
    '1.6.7',
    '1.6.8',
    '1.6.9',
    '1.6.11',
    '2.0.0-alpha.1',
    '2.0.0-alpha.2',
    '2.0.0-alpha.3',
    '2.0.0-alpha.4',
    '2.0.0-alpha.5',
    '2.0.0-alpha.6',
    '2.0.0-alpha.7',
    '2.0.0-alpha.8',
    '2.0.0-alpha.9',
    '2.0.0-alpha.10',
    '2.0.0-rc.1',
    '2.0.0-rc.2',
    '2.0.0',
    '2.0.1',
    '2.0.2',
    '2.0.3',
    '2.0.4',
    '2.0.5',
    '2.0.6',
    '2.0.7',
    '2.0.8',
    '2.0.10',
    '2.1.0',
    '2.1.1',
    '2.1.2',
    '2.1.3',
    '2.1.4',
    '2.1.5',
    '2.1.6',
    '2.2.0',
    '2.2.1',
    '2.2.2',
    '2.2.3',
    '2.2.4',
    '2.2.5',
    '2.2.6',
    '2.2.7',
    '2.2.8',
    '2.2.9',
    '2.2.10',
    '2.2.11',
    '2.2.12',
    '2.2.13',
    '2.2.14',
    '2.2.15'
  ],
  homepage: 'https://github.com/vincit/objection.js#readme',
  keywords: [
    'orm',
    'knex',
    'sql',
    'query',
    'query builder',
    'postgresql',
    'mysql',
    'sqlite3'
  ],
  repository: {
    type: 'git',
    url: 'git://github.com/vincit/objection.js.git'
  },
  author: {
    name: 'Sami Koskimäki',
    email: 'sami@jakso.me',
    url: 'https://github.com/koskimas'
  },
  bugs: {
    url: 'https://github.com/vincit/objection.js/issues'
  },
  license: 'MIT',
  readmeFilename: 'README.md',
  users: {
    jsumners: true,
    onestone: true,
    mjurincic: true,
    womjoy: true,
    tmurngon: true,
    'joaquin.briceno': true,
    makay: true,
    ssljivic: true,
    richardsimko: true,
    tdevm: true,
    lassevolkmann: true,
    'arnold-almeida': true,
    'ilia.ivanov': true,
    cocorax: true,
    dccunni171: true,
    rethinkflash: true,
    cantonbolo: true,
    danielmackey: true,
    seinopsys: true,
    jolg42: true,
    newhouse: true,
    rexpan: true
  },
  contributors: [
    {
      name: 'Sami Koskimäki',
      email: 'sami@jakso.me',
      url: 'https://github.com/koskimas'
    },
    {
      name: 'Mikael Lepistö',
      email: 'mikael.lepisto@vincit.com',
      url: 'https://github.com/elhigu'
    },
    {
      name: 'Matthew McEachen',
      email: 'matthew-objection@photostructure.com',
      url: 'https://github.com/mceachen'
    },
    {
      name: 'Jürg Lehni',
      email: 'juerg@scratchdisk.com',
      url: 'https://github.com/lehni'
    },
    {
      name: 'Igor Savin',
      email: 'kibertoad@gmail.com',
      url: 'https://github.com/kibertoad'
    }
  ],
  version: '2.2.15',
  main: 'lib/objection.js',
  scripts: {
    test: 'npm run eslint && mocha --slow 10 --timeout 15000 --reporter spec --recursive tests --exclude "tests/unit/relations/files/**"',
    'test-travis': 'nyc mocha --slow 100 --timeout 60000 --reporter spec --recursive tests --exclude "tests/unit/relations/files/**" && npm run test-typings',
    'test-fast': 'mocha --slow 10 --timeout 15000 --reporter spec --recursive tests --bail --exclude "tests/unit/relations/files/**"',
    'test-opt': 'mocha --slow 10 --timeout 15000 --reporter spec --recursive tests --bail --trace_opt --trace_deopt --exclude "tests/unit/relations/files/**"',
    'test-debug': 'mocha --slow 10 --timeout 15000 --reporter spec --recursive tests --inspect-brk --exclude "tests/unit/relations/files/**"',
    'test-sqlite': 'cross-env DATABASES=sqlite3 mocha --slow 10 --timeout 15000 --reporter spec --recursive tests --exclude "tests/unit/relations/files/**"',
    'test-typings': 'tsc',
    coveralls: 'cat ./testCoverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js',
    perf: 'mocha --slow 60000 --timeout 60000 --reporter spec --recursive perf',
    'perf-debug': 'mocha --slow 60000 --timeout 60000 --reporter spec --inspect-brk perf',
    'perf-opt': 'mocha --slow 60000 --timeout 60000 --reporter spec --recursive perf --trace_opt --trace_deopt',
    prettier: 'prettier --write "{examples,lib,tests,typings,doc}/**/*.{js,ts}"',
    eslint: 'eslint --format codeframe "examples/**/*.js" "lib/**/*.js" "tests/**/*.js"',
    'docs:dev': 'vuepress dev doc',
    'docs:build': 'vuepress build doc'
  },
  publishConfig: {
    tag: 'next'
  },
  engines: {
    node: '>=8.0.0'
  },
  types: './typings/objection/index.d.ts',
  dependencies: {
    ajv: '^6.12.6',
    'db-errors': '^0.2.3'
  },
  peerDependencies: {
    knex: '<0.95.0'
  },
  devDependencies: {
    '@types/node': '^14.14.13',
    chai: '^4.2.0',
    'chai-subset': '^1.6.0',
    coveralls: '^3.1.0',
    'cross-env': '^7.0.3',
    eslint: '^7.15.0',
    'eslint-plugin-prettier': '^3.2.0',
    'expect.js': '^0.3.1',
    'fs-extra': '^9.0.1',
    glob: '^7.1.6',
    husky: '^4.3.6',
    knex: '0.21.15',
    'lint-staged': '^10.5.3',
    mocha: '^8.2.1',
    mysql: '^2.18.1',
    nyc: '^15.1.0',
    pg: '^8.5.1',
    prettier: '2.2.1',
    sqlite3: '^5.0.0',
    typescript: '^4.1.3',
    vuepress: '1.7.1'
  },
  nyc: {
    description: 'test coverage',
    exclude: [
      'lib/queryBuilder/parsers/jsonFieldExpressionParser.js',
      'lib/queryBuilder/parsers/relationExpressionParser.js',
      'testUtils/*',
      'lib/utils/clone.js'
    ],
    reporter: [
      'lcov',
      'text'
    ],
    'report-dir': './testCoverage'
  },
  husky: {
    hooks: {
      'pre-commit': 'lint-staged'
    }
  },
  'lint-staged': {
    '*.js': [
      'prettier --write',
      'eslint --fix',
      'git add'
    ],
    '*.{yml,ts}': [
      'prettier --write',
      'git add'
    ]
  },
  gitHead: '260b284a1cbfb044991894c5a3cf3dedc8ce7267',
  dist: {
    integrity: 'sha512-ZOLJDigE9Z2ppk3C//S2fcWL6ph2jUe6Cwl0CEpslTZegnnOeG6RPIV80nhPAaghWjl/8F2kox/w89VVBN4ccg==',
    shasum: '104ecb180b0d2e8dff756a83886be035e3d323e5',
    tarball: 'https://registry.npmjs.org/objection/-/objection-2.2.15.tgz',
    fileCount: 181,
    unpackedSize: 649332,
    'npm-signature': '-----BEGIN PGP SIGNATURE-----\r\n' +
      'Version: OpenPGP.js v3.0.13\r\n' +
      'Comment: https://openpgpjs.org\r\n' +
      '\r\n' +
      'wsFcBAEBCAAQBQJgUJzVCRA9TVsSAnZWagAASX4P/RMye0+u6LDTdThX3bda\n' +
      'DSIyGK91mimCCby9PA3Arj6CznFZWDCwJ6PLbysV40gZeLX5JkH5GGEj/7oF\n' +
      'wB1K6MdJGG4RRhd1aDxra71xVqK6htAfD7Wi/ll7u7sGdt3OfcUwyPy0yYs3\n' +
      'l/R+ryaTB15FMLK52ZiA1FhRtsiyCXO1FTpahpZNx/xF9Z/1hl3GtXWKLwBT\n' +
      '0D4M/MSd0PsadeA189cLJ9O37wdH2YCifFFiX3mdMrBfIcD1mgDlNScca+Op\n' +
      'UqdRVKmI/MlEeH7bUpUiyKoUzIzXDZZvQGAg2gFuo48zvAkcRcaEdf2vj1iM\n' +
      'Lkgeisk2yJIxS9pzX28d4pv3QfALOiUL1kYEGe/jY51yNTYN2X3GyEvw8fg7\n' +
      'yl1/dJzgr7KfNL0O75LW/jQUvJzKZbliyu1+6Vg/nDOEowPcWmFUn8M7vBLN\n' +
      '2yXyqTMUI3oPd8zERlCdrSyd1ydfH9xzpi55GI/UQ75WPwvC+Wlnv47vg2nL\n' +
      '/nc0XG33rsRjqkvKsoFkJ66nuC73Eug/mcFZ+53uwYSleD0g4FxTBFjbH6m1\n' +
      '83U1/tUZcyJMToTAYOhU6V/S3q+ym0aI2iA+5fLcFX+74P0fHcIqUBtdVIsk\n' +
      'mbFA5hjoyY5kc6UIMQitVvaejP4FgH5JLDTpj4VdDMZpuRzMDLiou8yO38UI\n' +
      '7qCY\r\n' +
      '=rlGT\r\n' +
      '-----END PGP SIGNATURE-----\r\n'
  },
  directories: {}
}
koskimas commented 3 years ago

Super weird that it only happens on some specific version. You are not using Babel or some other transpiler are you?

koskimas commented 3 years ago

I just realized that objection only supports AJV up to 6, so v8 failing is not a surprise. #1993