Julien-R44 / tuyau

RPC / E2E Client For AdonisJS
https://tuyau.julr.dev
MIT License
98 stars 3 forks source link

TypeError: routes is not iterable #20

Open craigharman opened 2 weeks ago

craigharman commented 2 weeks ago

I've just installed tuyau and tried to generate using node ace tuyau:generate but I get the error: TypeError: routes is not iterable. My routes are located in a folder in individual folder rather than in one routes.ts file, wondering if that's the reason? Anything I can do to fix?

Julien-R44 commented 2 weeks ago

Can you explain your routes setup a bit more please? If you can also send the output of noce ace list:routes --json please

craigharman commented 2 weeks ago

Sure. Rather than having a routes.ts file I have a folder routes/ that contains routing files: app.ts public.ts etc. Running the ace command I get Error: Cannot find module '/Users/.../start/routes.js'

That is because it doesn't exist! My routes are in /routes/

Julien-R44 commented 2 weeks ago

Try adding this code somewhere and give me the output please:

const router = await this.app.container.make('router')
router.commit()

console.log(router.toJSON())

Alternatively, try looking at this issue: https://github.com/Julien-R44/tuyau/issues/8 You may be facing the same problem.

And also if you can make a minimal reproduction, it would be ideal to be able to help you :)

craigharman commented 2 weeks ago

I thought this may be related to having routes in a folder but I created a new project from scratch and moved the routes.ts and the types are generated successfully so it doesn't appear to be that.

craigharman commented 2 weeks ago

I reviewed #8 and can confirm I'm already using subpath imports.

Julien-R44 commented 1 day ago

Please provide a reproduction otherwise I can't help :/