Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres-array not resolved with yarn v4 (Error: Please install postgres-array package manually) #17272

Closed
3 of 6 tasks
QuentinFarizon opened this issue Apr 9, 2024 · 2 comments

Comments

@QuentinFarizon
Copy link

QuentinFarizon commented Apr 9, 2024

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Bug Description

I have started a new project with yarn v4 and sequelize, and I can't connect with postgres.

Error: Please install postgres-array package manually

Error: @sequelize/core tried to access postgres-array, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

What do you expect to happen?

postgres-array is installed, it should find it (I installed pg which brings it through pg-types).

What is actually happening?

/project-path/.yarn/__virtual__/@sequelize-core-virtual-22c149e4d2/4/.yarn/berry/cache/@sequelize-core-npm-7.0.0-alpha.33-3306c2ef8d-10c0.zip/node_modules/@sequelize/core/src/dialects/abstract/connection-manager.ts:140
        throw new Error(`Please install ${moduleName} package manually`);
              ^
Error: Please install postgres-array package manually
    at PostgresConnectionManager._loadDialectModule (/project-path/.yarn/__virtual__/@sequelize-core-virtual-22c149e4d2/4/.yarn/berry/cache/@sequelize-core-npm-7.0.0-alpha.33-3306c2ef8d-10c0.zip/node_modules/@sequelize/core/src/dialects/abstract/connection-manager.ts:140:15)
    at new PostgresConnectionManager (/project-path/.yarn/__virtual__/@sequelize-core-virtual-22c149e4d2/4/.yarn/berry/cache/@sequelize-core-npm-7.0.0-alpha.33-3306c2ef8d-10c0.zip/node_modules/@sequelize/core/src/dialects/postgres/connection-manager.ts:67:33)
    at new PostgresDialect (/project-path/.yarn/__virtual__/@sequelize-core-virtual-22c149e4d2/4/.yarn/berry/cache/@sequelize-core-npm-7.0.0-alpha.33-3306c2ef8d-10c0.zip/node_modules/@sequelize/core/src/dialects/postgres/index.ts:103:30)
    at new Sequelize (/project-path/.yarn/__virtual__/@sequelize-core-virtual-22c149e4d2/4/.yarn/berry/cache/@sequelize-core-npm-7.0.0-alpha.33-3306c2ef8d-10c0.zip/node_modules/@sequelize/core/src/sequelize.js:416:20)
    at getSequelizeInstance (/project-path/api/core/sequelize.ts:36:10)
    at connect (/project-path/api/core/sequelize.ts:16:23)
    at getModels (/project-path/api/models/index.ts:13:60)
    at Object.<anonymous> (/project-path/api/bin/worker.ts:17:33)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module.m._compile (/project-path/.yarn/__virtual__/ts-node-virtual-1c21828d8d/4/.yarn/berry/cache/ts-node-npm-10.9.2-3f3890b9ac-10c0.zip/node_modules/ts-node/src/index.ts:1618:23)

[$  (master)]$ yarn why sequelize
[$  (master)]$ yarn why @sequelize/core
└─ api@workspace:api
   └─ @sequelize/core@npm:7.0.0-alpha.33 [ee769] (via npm:7.0.0-alpha.33 [ee769])
[$  (master)]$ yarn why pg
└─ api@workspace:api
   └─ pg@npm:8.11.3 [ee769] (via npm:8.11.3 [ee769])
[$  (master)]$ yarn why postgres-array
└─ pg-types@npm:2.2.0
   └─ postgres-array@npm:2.0.0 (via npm:~2.0.0)

Environment

  • Sequelize version: 7.0.0-alpha.37
  • Node.js version: 20.9.0
  • If TypeScript related: TypeScript version: 5.4.4
  • Database & Version: PostgreSQL 16
  • Connector library & Version: pg 8.11.3

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 will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.

Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.

@QuentinFarizon QuentinFarizon added pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet type: bug labels Apr 9, 2024
@WikiRik
Copy link
Member

WikiRik commented Apr 9, 2024

This should be fixed in the next alpha release where we use @sequelize/postgres where postgres-array is defined explicitly. See https://github.com/sequelize/sequelize/blob/main/packages/postgres/package.json

We will release that alpha once we've updated the docs; sequelize/website#742

@ephys
Copy link
Member

ephys commented Apr 15, 2024

This has now been released - https://github.com/sequelize/sequelize/releases/tag/v7.0.0-alpha.40

@ephys ephys closed this as completed Apr 15, 2024
@ephys ephys removed the pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants