Skip to content

Unable to use 6.0.0-beta.6 with core-js #12358

@ezze

Description

@ezze

Issue Description

I'm using Webpack with core-js polyfill in my Node.js project relying on Sequelize library. I decided to make an earlier migration from Sequelize 5 to Sequelize 6 but was unable to make it working to due this error:

/home/ezze/Development/geobase/node_modules/lodash/lodash.js:11927
        throw new Error(CORE_ERROR_TEXT);
        ^

Error: Unsupported core-js use. Try https://npms.io/search?q=ponyfill.
    at Function.isNative (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:11927:15)
    at _.mergeWith (/home/ezze/Development/geobase/node_modules/sequelize/lib/utils.js:54:42)
    at baseMergeDeep (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:3643:11)
    at /home/ezze/Development/geobase/node_modules/lodash/lodash.js:3603:11
    at /home/ezze/Development/geobase/node_modules/lodash/lodash.js:4905:15
    at baseMerge (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:3600:7)
    at baseMergeDeep (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:3689:9)
    at /home/ezze/Development/geobase/node_modules/lodash/lodash.js:3603:11
    at /home/ezze/Development/geobase/node_modules/lodash/lodash.js:4905:15
    at baseMerge (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:3600:7)
    at baseMergeDeep (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:3689:9)
    at /home/ezze/Development/geobase/node_modules/lodash/lodash.js:3603:11
    at /home/ezze/Development/geobase/node_modules/lodash/lodash.js:4905:15
    at baseMerge (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:3600:7)
    at baseMergeDeep (/home/ezze/Development/geobase/node_modules/lodash/lodash.js:3689:9)
    at /home/ezze/Development/geobase/node_modules/lodash/lodash.js:3603:11

What are you doing?

Upgrading Sequelize 5 => 6. I narrowed down the problem and created a repo to reproduce it. The issue is caused by _.isNative() function that is incompatible with core-js and is used by mergeDefaults utility function of Sequelize.

This method can't reliably detect native functions in the presence of the core-js package because core-js circumvents this kind of detection. Despite multiple requests, the core-js maintainer has made it clear: any attempt to fix the detection will be obstructed. As a result, we're left with little choice but to throw an error. Unfortunately, this also affects packages, like babel-polyfill, which rely on core-js.

What do you expect to happen?

The code working in Sequelize 5 to work in Sequelize 6.

What is actually happening?

An error

Error: Unsupported core-js use. Try https://npms.io/search?q=ponyfill.

is thrown.

Environment

  • Sequelize version: 6.0.0-beta.6
  • Node.js version: 10.21.0
  • Operating System: Ubuntu 18.04 LTS

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s):
  • I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependencyFor issues and PRs. Things that are related to one or more dependencies.released

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions