Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Reason for "Oops! It looks like this is taking longer than expected."
We developed a website using Liferay 7.0.6 GA7. We make use of Web Content Templates and Asset Display Templates. Those contain some Javascript, too.
Now when a normal user visits the website (not logged in) sometimes a message "Oops! It looks like this is taking longer than expected." is shown in the top right corner of the website.
I assume that it is caused by a Javascript in one of our templates. How can we track it down to check which Javascript causes this problem? What are the circumstances that this message is displayed? There are no errors in the browser console.
Now when a normal user visits the website (not logged in) sometimes a message "Oops! It looks like this is taking longer than expected." is shown in the top right corner of the website.
I assume that it is caused by a Javascript in one of our templates. How can we track it down to check which Javascript causes this problem? What are the circumstances that this message is displayed? There are no errors in the browser console.
Hey Dominik!
In other instances of this, we've always concluded that some exception was being thrown by custom code (and caught by Senna) resulting in that endless loading.
First thing I'd try is to enable the "Pause on caught exceptions" setting in your DevTools and see if that points you to the right place.
In other instances of this, we've always concluded that some exception was being thrown by custom code (and caught by Senna) resulting in that endless loading.
First thing I'd try is to enable the "Pause on caught exceptions" setting in your DevTools and see if that points you to the right place.
Thanks Chema for your help.
I was able to track it down to a Javascript error inside our templates.
So if I understand you correctly everytime a Javascript error occurs on a page that "Oops"-message is shown? Why? That message does not give a normal user anything, the user cannot do anything about it.
Maybe a better message would be something like "Hey visitor! The following (Javascript) error occurred: <message here>. Please inform the administrator of this website".
I was able to track it down to a Javascript error inside our templates.
So if I understand you correctly everytime a Javascript error occurs on a page that "Oops"-message is shown? Why? That message does not give a normal user anything, the user cannot do anything about it.
Maybe a better message would be something like "Hey visitor! The following (Javascript) error occurred: <message here>. Please inform the administrator of this website".
Hey Dominik!
You are indeed correct... we could do a better job at messaging the issue. The problem if I remember correctly is that we have some try-catch block when evaluating incoming scripts that might make the navigation stop, thus showing the "Ooops" message.
Since this has happened mostly at development time, we haven't fully explored what would be a better option. I don't think showing a stacktrace to the end user would be benefitial at all, but maybe we could log the error in the console so developers are properly notified and show a friendly error message instead of leaving the user hanging in a never-ending loading.
Could you maybe provide a simple reproduction case so we can study that in context and try to come up with a friendlier solution?
Thanks!
You are indeed correct... we could do a better job at messaging the issue. The problem if I remember correctly is that we have some try-catch block when evaluating incoming scripts that might make the navigation stop, thus showing the "Ooops" message.
Since this has happened mostly at development time, we haven't fully explored what would be a better option. I don't think showing a stacktrace to the end user would be benefitial at all, but maybe we could log the error in the console so developers are properly notified and show a friendly error message instead of leaving the user hanging in a never-ending loading.
Could you maybe provide a simple reproduction case so we can study that in context and try to come up with a friendlier solution?
Thanks!
Hey Chema,
I think the most simple test case is the following. Just put the following snippet in a page (using a template or something like that) and navigate to a new page afterwards.
I think the most simple test case is the following. Just put the following snippet in a page (using a template or something like that) and navigate to a new page afterwards.
Liferay.on('endNavigate', function() { throw "error!"; });
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™