Closed leofmarciano closed 7 months ago
Hey @leofmarciano! 👋🏻
Since your route is inside a specific domain, you need to specify it.
router
.builderForDomain('blog.adonisjs.com')
.params({ id: 1 })
.make('posts.show')
📚 https://docs.adonisjs.com/guides/url-builder#making-url-for-routes-under-a-domain
Package version
@adonisjs/core@6.2.2
Describe the bug
We've identified a potential bug in the route creation process using
router.builder()
. It seems related to the order of its use. When used directly in start/routes.ts, it works as expected. However, moving the same piece of code into folders, such asroutes/v1/verify_account.ts
, it stops working as expected, returning the error "Cannot lookup route".We tested by copying and pasting directly from the documentation, as shown in the images.
The issue occurs when trying to generate the route using the URL Builder. If the route is directly in
routes.ts
, it functions normally. However, attempting to use it by importing routes from a file, likeroutes/v1/verify_account.ts
, results in the error.It doesn't seem like it was intended to work this way.
Environment and Version
Steps to Reproduce
makeSignedUrl
code as per the documentation.router.builder()
.router.builder()
.Expected Behavior
Generate a signed route, which can be used to validate information, access, email, and so on.
Current Behavior
Besides the "Cannot lookup route" error.
Code Examples
Error
Reproduction repo
No response