loopbackio / loopbackio/loopback-next

Cannot load db.datasource.config.json: ENOENT: no such file or directory

Open
#8,465 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

Describe the bug

I got this error after upgrade cli version to 3.2.0
There is db.datasource.ts file in /src/datasources folder.
but cli require db.datasource.config.json file.
image

so to fix remove error I create empty db.datasource.config.json file in datasources folder
but I got other error when I create repository by cli command.
image
I think it's bug.
Please fix asap.

Logs

No response

Additional information

#lb4 --version
@loopback/cli version: 3.2.0

@loopback/* dependencies:

  • @loopback/authentication: ^8.1.2
  • @loopback/boot: ^4.1.2
  • @loopback/build: ^8.1.2
  • @loopback/context: ^4.1.2
  • @loopback/core: ^3.1.2
  • @loopback/metadata: ^4.1.2
  • @loopback/openapi-spec-builder: ^4.1.2
  • @loopback/openapi-v3: ^7.1.2
  • @loopback/repository-json-schema: ^5.1.2
  • @loopback/repository: ^4.1.2
  • @loopback/rest: ^11.1.2
  • @loopback/testlab: ^4.1.2
  • @loopback/docs: ^4.0.4
  • @loopback/example-hello-world: ^4.1.2
  • @loopback/example-log-extension: ^4.1.2
  • @loopback/example-rpc-server: ^4.1.2
  • @loopback/example-todo: ^5.1.2
  • @loopback/example-soap-calculator: ^4.1.2
  • @loopback/service-proxy: ^4.1.2
  • @loopback/http-caching-proxy: ^3.1.2
  • @loopback/http-server: ^3.1.2
  • @loopback/example-todo-list: ^5.1.2
  • @loopback/dist-util: ^0.4.0
  • @loopback/rest-explorer: ^4.1.2
  • @loopback/eslint-config: ^12.0.4
  • @loopback/example-express-composition: ^4.1.2
  • @loopback/example-greeter-extension: ^4.1.2
  • @loopback/booter-lb3app: ^3.1.2
  • @loopback/example-lb3-application: ^4.1.2
  • @loopback/example-greeting-app: ^4.1.2
  • @loopback/example-context: ^4.1.2
  • @loopback/repository-tests: ^0.20.2
  • @loopback/health: ^0.10.2
  • @loopback/authorization: ^0.11.2
  • @loopback/rest-crud: ^0.13.2
  • @loopback/security: ^0.7.2
  • @loopback/authentication-passport: ^4.1.2
  • @loopback/example-metrics-prometheus: ^0.9.2
  • @loopback/metrics: ^0.10.2
  • @loopback/model-api-builder: ^3.1.2
  • @loopback/logging: ^0.8.2
  • @loopback/example-access-control-migration: ^4.1.2
  • @loopback/example-file-transfer: ^3.1.2
  • @loopback/example-rest-crud: ^3.1.2
  • @loopback/apiconnect: ^0.9.2
  • @loopback/example-validation-app: ^3.1.2
  • @loopback/cron: ^0.8.2
  • @loopback/example-multi-tenancy: ^0.12.2
  • @loopback/example-passport-login: ^3.1.2
  • @loopback/authentication-jwt: ^0.11.2
  • @loopback/context-explorer: ^0.7.2
  • @loopback/express: ^4.1.2
  • @loopback/example-todo-jwt: ^3.1.2
  • @loopback/mock-oauth2-provider: ^0.5.2
  • @loopback/pooling: ^0.7.2
  • @loopback/typeorm: ^0.6.2
  • @loopback/example-graphql: ^0.6.2
  • @loopback/graphql: ^0.7.2
  • @loopback/filter: ^2.1.2
  • @loopback/rest-msgpack: ^0.7.2
  • @loopback/example-binding-resolution: ^0.6.2
  • @loopback/example-webpack: ^0.7.2
  • @loopback/example-socketio: ^0.5.2
  • @loopback/socketio: ^0.5.2
  • @loopback/monorepo: ^0.4.4
  • @loopback/tsdocs: ^3.1.2
Reproduction

cli version is 3.2.0 and I write loopback version list.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CLI path that handles db.datasource.ts in the /src/datasources folder and attempts to load db.datasource.config.json when creating a repository. Reproduce with CLI version 3.2.0 and the repository-generation command, then verify the command works without requiring an unexpected configuration file.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.