Skip to content

pg-native incorrectly accessed for lodash@^4.4.0 #5476

Closed

Description

@jasonchoimtt

The following code errors for lodash@^4.4.0:

var Sequelize = require('sequelize');
var sequelize = new Sequelize('postgres://localhost/db', {
    native: false,
});

var User = sequelize.define('user', {});

var Role = sequelize.define('role', {}, {
    defaultScope: {
        include: [User],
    },
}); // throws Error: Cannot find module 'pg-native'

The main point is that lib/sequelize.js:574 calls _.merge, which proceeds to inspect:

options.defaultScope.include[0].options.sequelize.dialect.connectionManager.lib.pg.native

Since pg.native is a getter, it triggers the said error.

To fix it I think all _.merge need to be replaced.

Activity

  1. added
    type: bugDEPRECATED: replace with the "bug" issue type
    dependencyFor issues and PRs. Things that are related to one or more dependencies.
    on Feb 23, 2016
  2. janmeier commented on Feb 23, 2016

    @janmeier
    Member

    See #5438

  3. jibwa commented on Mar 3, 2016

    @jibwa

    Running into the same issue here.

  4. aliatsis commented on Apr 1, 2016

    @aliatsis

    +1

  5. janmeier commented on Apr 16, 2016

    @janmeier
    Member

    Should be fixed by #5745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependencyFor issues and PRs. Things that are related to one or more dependencies.type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions