node-rethinkdb-job-queue: includes is not a function

Hi,

When I run this module, I’m forced to use node --harmony_array_includes to have it running, otherwise I’m getting:

 if (Object.keys(enums.priority).includes(oldOptions.priority)) {
                                  ^
TypeError: Object.keys(...).includes is not a function
    at jobOptions (/opt/.../node_modules/rethinkdb-job-queue/dist/job-options.js:19:35)
    at new Queue (/opt/.../node_modules/rethinkdb-job-queue/dist/queue.js:55:25)

Any ideas ?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

I think there will be more than just the includes issue @hzoo. That’s up to you @thomasmodeneis if you want to try and fix each pollyfill.

Being that this is server side code, the extra package size is probably a non-issue.

I am starting to use more and more of the newer ES standards so the full pollyfill will prevent regressions.

The other option is to forget about transpiling and determine the minimum Node.js version required and just make is an install requirement.

OK @thomasmodeneis, I posted a message on the Babel slack channel and learned that Babel only transforms syntax and will not pollyfill.

Can I ask for you help here please? Can you install the babel-pollyfill locally (no need to save) and add the require("babel-polyfill") statement to the top of the dist/queue.js file in your local package of rethinkdb-job-queue? You will need to find the local package in your node_modules directory.

Here are the details about the pollyfill: http://babeljs.io/docs/usage/polyfill/

I can give more detailed instructions if that is not enough to help.