-
Notifications
You must be signed in to change notification settings - Fork 413
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
Please prettify the error page #1481
Comments
@cdcv can you provide an example of what page you're talking about? |
Thanks very much for your response, and for your help with this. CdC
|
@cdcv hey, i'm not seeing anything here |
Hmmm. I sent a reply email with an attached image of the screen. Is there a way to upload here? I am currently having the issue on a mobile device, so no easy way to copy/paste. Could also email it to you directly. Thanks. |
you could upload a screenshot to something like imgur. but from what you're describing it doesn't really sound like this is an issue with iron router per se |
Here is the screen that I'm talking about. |
@cdcv interesting. that's the screen you get when no routes are defined... are you doing something like loading all of the routes dynamically? |
hmm, seems like the same issue as #1290? |
Not sure if it's the same as 1290. It seems that Meteor is still in the midst of loading the routes, and when it finishes the screen goes away and the app commences (or sometimes it crashes). |
Looking more closely, this isn't the same as 1290, as removing code part by part doesn't solve it. It seems to be caused by the sheer volume of code. For example, removing either half of a bunch of meteor code will make the problem go away, but if both halves are present then this is the result. Again, it seems to be due to the time required to load all the code before the routes become valid and the app can start. |
Sometimes get the same error screen if other things prevent the routes from correctly loading, eg certain js issues. |
@cdcv having a custom error screen could be a useful feature, but it seems like there's an actual issue with your app structure that causes you to see this screen... or some deeper underlying issue with IR and cordova? |
A custom error screen would be a big help. And I'd sure appreciate it if you make one (guessing that others would too). I don't think that the issue we are having is a traditional problem with the app code (other than that there is too much of it), but perhaps is better thought of as 'deeper'. You might try creating a large app with a very large number of templates/js files, and I suspect that will produce the effect, though I haven't tried it. I know that I've gotten this same error screen in other ways as well, but can't remember what they were at the moment (just remember that the actual error didn't have anything to do with what it says on the screen. Thanks for your help. |
@cdcv are you using reload-on-resume, by chance? or serving assets out of the public folder? there are also a few other possibilities that might be causing this generally i think that screen actually looks pretty good for the purpose it serves, and also it really doesn't make sense to add a "feature" which is really a work-around for one specific edge case that can't be shown to be an actual bug and not user error. does that make sense? |
Hi Chris. We're not using reload-on-resume. Thanks for your help. |
hey @cdcv, that's most likely your problem. in production mode, meteor bundles the entire app, including the public folder... and so your app is waiting for the entire bundle to be loaded before running the code that initializes the routes the preferred method of serving static assets is to use a 'cdn' (i.e. a separate server or s3) the problem here is the same as #1289 (comment), where the problem occurs completely outside of the router, and detecting this is totally outside of the scope of the package |
also, there is already a way to set a custom error screen for actual router errors, which is |
I'd like to point out that we are serving it from the public folder precisely because when we were serving the assets from S3, the load times were often too slow due to network traffic etc and we would see the same error. |
@cdcv you're not getting it. if iron router doesn't find any routes, it's not going to find your code that defines a custom template for the 'noRoutes' condition... (if that feature were to be added) |
OK, then this brings me back to the initial suggestion: please make it possible to customize the iron:router error screen so that it is end-user-appropriate. Perhaps it can have a 'technical' link to the current screen. |
that's exactly what i'm saying... customize it how/where? do you not see the problem with your suggestion and why it doesn't work/make sense? whatever code would need to run to load that customization wouldn't be run because of other problems with your application architecture... same as the routes |
Well I'm afraid I don't. There is currently content/code that produces the existing error screen. You've probably got better ideas for how to solve this than I do, but here are a couple that I can think of:
|
Also, if this error page comes up if there are too many assets, if the page is going to be coder-directed, it would be good to make clear on the error page what the cause might be. |
you could certainly install the that seems to be your best short-term option if you have no intention of actually addressing the issue of loading megabytes of data before your app can actually start unfortunately, i think there's too much complexity in your suggestions to make it worth trying to add that feature, especially when (whether you want to agree with this or not) this is a screen that will only be shown to end users if there are other problems in your app (which, historically, have been fixable by everyone else who has so far encountered this problem) if you're able to submit a PR that provides a fix (along with a workable reproduction and documentation) we'd certainly be willing to incorporate that into the package good luck! |
@cdcv there's really no simple way for the router to tell what issue with your code is the show-stopper... and it's really outside the scope of a routing package to try to do this kind of debugging also, the issue with large public folders is a Meteor one, and the limitations/solutions are known meteor/meteor#4119 https://forums.meteor.com/t/first-visit-loads-are-ridiculously-slow/3028 |
Chris, thanks for your help with this. We'll find a solution among all of this -- probably one for short-term and one for long-term. If we end up creating a local version of the router, will send you a PR. |
Still don't agree with the error page. |
@Slanman3755 don't agree with it how? |
In a production environment I think there should be a short error message with no styling. |
@cdcv @Slanman3755 this exists now |
Please create an error page that is more suited to production environments.
We realize that we don't want to be having Iron:Router errors in production environments, but it has happened and... well... it ain't pretty. That's sure not what we want our users to see if something goes wrong.
Our experience has been that the error page (in the several thousand times that we've seen it) has never presented any useful information.
Please either change it to look less error-full or, and this would be great, allow us to provide content or a URL link for what will be seen if this page tries to display.
Just to be clear, I'm talking about the page that comes up if (e.g.) the code includes duplicate routes, the JS code hasn't loaded correctly, etc.
Thanks
The text was updated successfully, but these errors were encountered: