-
Notifications
You must be signed in to change notification settings - Fork 17
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
Alert about not loaded files in routes folder #480
Comments
Hi @monolithed , I suppose that you have no routes because you didn't configure TypeScript properly, so there is an error when trying to load them. I think that adding a check to infere the cause of the reason of any possible error in route files may not be possible, or at least it may not worth. Currently you can see warnings in the server logs, in the CLI, and even in the admin REST API when there are errors loading routes, so I think it could be enough to deduce why there are no routes loaded. In order to improve it, maybe the warning message could include a clearer notice informing that the routes in the file won't be loaded because of the error. And maybe we can also add a link below the documentation TypeScript examples to the "Configuring TypeScript" chapter. |
@javierbrea I created this issue due to my own inattentiveness. From the examples in the documentation, I got the impression that TypeScript support is built-in. That's not the case, and I realized that upon revisiting the documentation. Nevertheless, I believe this issue is relevant because there is no explanation in the logs for people who make the same mistake. What I mean is that the routing files exist, but the server acts as if they don't. Why not add information stating that the files exist, but an adapter needs to be included for the server to pull them? |
Hi again @monolithed , the problem is that the server doesn't look for |
@javierbrea hi, I got it, what if you add this information about the possible absence of a TS adapter only to the --verbose log output? |
I'm not sure about that. As I said, searching only for .ts files is too much coupled to a specific usage. Maybe it could be implemented as a generic search for any type of not loaded files in the routes folder, and, in that case, add a warning about them. I suppose that it may be helpful in case you are trying to use TypeScript without enabling it, because you'll see that the files are not loaded, and it also may be helpful in any other case. I'll let the issue opened and I'll rename it into "Add warning about not loaded files in routes folder", if you don't mind. If you need this feature right now, you can implement it in a plugin or you could even implement it in the core and open a PR, that are always welcome 😃 |
First of all, I want to say thank you for your work!
It's a bit unclear from the logs why there are no routes when they actually exist.
I suggest adding a check for the presence of TS files, so that the reason for the issue can be understood immediately.
The text was updated successfully, but these errors were encountered: