loopbackio / loopbackio/loopback-next
lb4 relation doesn't find models
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
Describe the bug
I have a project with a lot of models. I organized the models in "sub directories" inside "models" directory.
The "export" is working properly and all the project is working.
What is not working is the possibility to add repositories, relations or anything else
"lb4 relation" stops with an error "Generation is aborted: Error: No models found in ".../src/models"."
I expect the script to be capable to look for models also inside according to what is available in "index.ts" from "models" directory.
Logs
No response
Additional information
No response
Reproduction
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the lb4 relation command and the reproduction project linked in the issue, then inspect how it scans src/models and uses that directory's index.ts. The work is done when models organized in subdirectories are discovered for relation or repository generation instead of producing “No models found.”
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100