sourcefuse / loopback4-starter

Loopback 4 starter application. Multi-tenant architecture supported. Authentication, Authorization, Soft deletes, environment vars, Audit logs, included.
MIT License
158 stars 59 forks source link

error using lb4 repositoru #52

Closed georve closed 3 years ago

georve commented 4 years ago

I 'm trying to add a new repository for a connection to get data from another app and in console appears the following error, it is like a failure with the audit datasource

lb4 repository (node:2882) UnhandledPromiseRejectionWarning: Error: Cannot load /home/georman/Documents/crm-api/src/datasources/pgdb.datasource.config.json: ENOENT: no such file or directory, open '/home/georman/Documents/crm-api/src/datasources/pgdb.datasource.config.json' at Object.openSync (fs.js:458:3) at Object.readFileSync (fs.js:360:35) at readDataSourceConfigFromJSON (/usr/lib/node_modules/@loopback/cli/lib/utils.js:641:26) at Object.getDataSourceConfig (/usr/lib/node_modules/@loopback/cli/lib/utils.js:612:5) at Object.exports.isConnectorOfType (/usr/lib/node_modules/@loopback/cli/lib/utils.js:583:26) at /usr/lib/node_modules/@loopback/cli/generators/repository/index.js:264:28 at Array.filter () at RepositoryGenerator.promptDataSourceName (/usr/lib/node_modules/@loopback/cli/generators/repository/index.js:263:50) (node:2882) 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: 1) (node:2882) [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.

mayank-SFIN571 commented 4 years ago

Hi @georve In the updated versions of loopback, datasource don't come with config.json file.

Can you share what version of @loopback/cli you are using.

This looks like a version mismatch issue.

samarpan-b commented 4 years ago

Hello @georve , is the issue resolved ? Did you try upgrading to latest LB4 ?

samarpan-b commented 3 years ago

Let us know @georve if we can close this issue now.

georve commented 3 years ago

hi yes.. it was an issue with json file when the json is present appear this error,, y move the content to the datasource y I could execute the command

samarpan-b commented 3 years ago

Thanks a lot. So I can close this issue now ?