Loopback 4.x - "Error: The connector has not been initialized."
Loopback 4.x - "Error: The connector has not been initialized."
我目前正在采用一个基于 Loopback 构建的项目。我正在尝试切换到开发数据库,并且主要通过查找和替换策略来解决问题。
将对生产数据库的所有引用更改为指向开发数据库后,出现错误:
Cannot start the application. Error: The connector has not been initialized.
at PostgresDataSource.freeze (project/api/node_modules/loopback-datasource-juggler/lib/datasource.js:1982:11)
at PostgresDataSource.DataSource.autoupdate (project/api/node_modules/loopback-datasource-juggler/lib/datasource.js:1068:8)
at InstrideIdentityApiApplication.migrateSchema (project/api/node_modules/@loopback/repository/dist/mixins/repository.mixin.js:186:40)
at <anonymous>
我不知道这是什么意思。我尝试在 git 中搜索到 find the error code, but got no results. I've looked into the docs on connectors 的环回,但它没有说明连接器在哪个阶段变为 "initialized."
我的问题是:
- 这个错误到底想告诉我什么?
- 人们通常会做什么来修复它?
What exactly is this error trying to tell me?
错误告诉您您的数据源没有配置任何连接器。如果您查看堆栈跟踪,则会在调用 migrateSchema
时触发错误。没有连接器,数据源不知道如何连接到数据库,因此无法执行模式迁移。
What does one typically do to fix it?
确保您的数据源配置包含 connector
属性.
我目前正在采用一个基于 Loopback 构建的项目。我正在尝试切换到开发数据库,并且主要通过查找和替换策略来解决问题。
将对生产数据库的所有引用更改为指向开发数据库后,出现错误:
Cannot start the application. Error: The connector has not been initialized.
at PostgresDataSource.freeze (project/api/node_modules/loopback-datasource-juggler/lib/datasource.js:1982:11)
at PostgresDataSource.DataSource.autoupdate (project/api/node_modules/loopback-datasource-juggler/lib/datasource.js:1068:8)
at InstrideIdentityApiApplication.migrateSchema (project/api/node_modules/@loopback/repository/dist/mixins/repository.mixin.js:186:40)
at <anonymous>
我不知道这是什么意思。我尝试在 git 中搜索到 find the error code, but got no results. I've looked into the docs on connectors 的环回,但它没有说明连接器在哪个阶段变为 "initialized."
我的问题是:
- 这个错误到底想告诉我什么?
- 人们通常会做什么来修复它?
What exactly is this error trying to tell me?
错误告诉您您的数据源没有配置任何连接器。如果您查看堆栈跟踪,则会在调用 migrateSchema
时触发错误。没有连接器,数据源不知道如何连接到数据库,因此无法执行模式迁移。
What does one typically do to fix it?
确保您的数据源配置包含 connector
属性.