Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: routes is not iterable #20

Open
craigharman opened this issue Nov 6, 2024 · 6 comments
Open

TypeError: routes is not iterable #20

craigharman opened this issue Nov 6, 2024 · 6 comments

Comments

@craigharman
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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: #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
Copy link
Author

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
Copy link
Author

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

@Julien-R44
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants