Skip to content

[4.2 beta] - Error: Unknown dialect undefined on strapi().load() #12894

@boazpoolman

Description

@boazpoolman

Bug report

Describe the bug

When using the 4.2.0-beta.0 with typescript I get an error when I programatically load Strapi like this:

const strapi = require('@strapi/strapi');
// ...
const app = await strapi().load();

Steps to reproduce the behavior

  1. npx create-strapi-app@beta test-app-beta --ts use quickstart method
  2. cd test-app-beta
  3. yarn add strapi-plugin-config-sync
  4. yarn config-sync diff
  5. See error

Expected behavior

Strapi to load correctly

Code snippets (the error)

(node:96471) UnhandledPromiseRejectionWarning: Error: Unknown dialect undefined
    at getDialectClass (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/@strapi/database/lib/dialects/index.js:12:13)
    at getDialect (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/@strapi/database/lib/dialects/index.js:19:23)
    at new Database (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/@strapi/database/lib/index.js:38:20)
    at Function.Database.init (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/@strapi/database/lib/index.js:84:33)
    at Strapi.bootstrap (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/@strapi/strapi/lib/Strapi.js:383:30)
    at Strapi.load (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/@strapi/strapi/lib/Strapi.js:446:16)
    at async Command.<anonymous> (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/strapi-plugin-config-sync/server/cli.js:220:17)
    at async Command.parseAsync (/Users/boazpoolman/Code/boazpoolman/strapi/test-app-beta/node_modules/strapi-plugin-config-sync/node_modules/commander/lib/command.js:923:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:96471) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:96471) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

System

  • Node.js version: v14.19.0
  • Strapi version: 4.2.0-beta.0
  • Database: sqlite
  • Operating system: Mac OS (M1)

Additional context

When I do an non-typescript install of the beta this issue does not happen.

Metadata

Metadata

Assignees

Labels

issue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundstatus: confirmedConfirmed by a Strapi Team member or multiple community members

Type

No type

Projects

Status

Archived

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions