我目前正在采用一个基于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的回送,但是没有结果。我已经研究了docs on connectors,但是它没有阐明连接器被“初始化”到什么阶段。
我的问题是:
最佳答案
What exactly is this error trying to tell me?
错误告诉您数据源未配置任何连接器。如果查看堆栈跟踪,将在调用
migrateSchema
时触发错误。没有连接器,数据源将不知道如何连接到数据库,因此无法执行架构迁移。What does one typically do to fix it?
确保您的数据源配置包含
connector
属性。
关于compiler-errors - 回送4.x- “Error: The connector has not been initialized.”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55250918/