Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Missing index.js in dialects directory #5706

@puzzle-it-nu

Description

@puzzle-it-nu

Environment

Knex version: 3.0.0
Database + version: postgres 15
OS: linux fedora 38

Select applicable template from below.
If issue is about oracledb support, tag @ atiertant. For MSSql tag @ smorey2.
Rest of dialects don't need tags.
If issue is about TypeScript definitions, tag @ lorefnon.

Bug

Running vitest with the new knex 3.0.0 fails while the same test works with 2.5.1

  1. Error message
    `
    ❯ api/getSessionData/getSessionData.test.js (0 test)

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

FAIL api/getSessionData/getSessionData.test.js [ api/getSessionData/getSessionData.test.js ]
Error: Cannot find module '../../dialects'
Require stack:

  • /home/user/dev/gb/gbweb/node_modules/knex/lib/knex-builder/internal/config-resolver.js
  • /home/user/dev/gb/gbweb/node_modules/knex/lib/knex-builder/Knex.js
  • /home/user/dev/gb/gbweb/node_modules/knex/lib/index.js
    ❯ Object. node_modules/knex/lib/knex-builder/internal/config-resolver.js:5:37
    `

Looking at the specified folder show that in 3.0.0 there is no index.js and in 2.5.1 there is.
That explains why the require '../../dialects' fails in 3.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions