WordPress: Unknown 404 error in console - wordpress

While its not affecting the site it bugs me that I can't get rid of this 404 error in the console. When I view the page I get this message:
http://myproject.dev/undefined 404 (Not Found)
And when I click to see what it refers to it points to the same line as my doctype declaration, which is a standard . I run a few php variables before this but I tried to swap them out and I still get the message.
I've set up my WP site so that it defaults to a page and this page runs on the default page.php template. Any ideas?

Related

Next.js default 404 page is not shown for non-existing pages

I'm creating a next.js app.
And when I enter a non-existing URL, instead of seeing the default 404 page, I see this message:
Application error: a client-side exception has occurred (see the browser console for more information).
And when I open the console, all I see is this line repeating:
on-demand-entries-client.js?4540:45
GET https://localhost:3000/non-existing-url 404
eval # on-demand-entries-client.js?4540:45
eval # websocket.js?f03c:39
handleMessage # websocket.js?f03c:38
And here are the files in my pages directory. I have no custom _error.js page or 404.js page:
I'm stuck as there is no information whatsoever to tell me what's wrong in the console, and I have not created custom error pages.
What should I do?

SilverStripe static error page

Is it possible to set a static 404 error page without the need to create this page in the CMS SiteTree?
I tried setting an ErrorPage.ss in the Layout folder with the error text in there. It only works when the error page is created in the SiteTree.
The 404 error page in the site tree outputs the page html to /assets/error-404.html for use in the case the site tree 404 page is not found.
In our main .htaccess should be the following line that sets where the server should look for the static 404 error page:
ErrorDocument 404 /assets/error-404.html
If we unpublish our 404 error page in the site tree the server will use this static html page. We can then edit the /assets/error-404.html file to control the static 404 error page.

Blank screen on custom error 404 page

In IIS 8.5, I have a default web site with a custom page that handles 404 errors.
This custom page is default.asp, which is also the site's default document.
When a 404 error occurs and the default.asp happens to have any other error (for instance, a SQL query timeout), IIS shows only a blank page and not the actual error.
If default.asp is accessed explicitly (no 404 error), the error is correctly shown.
Steps to reproduce this problem:
Configure a web site with a 404 error document pointing to default.asp
Create a default.asp with a divide by zero error: <%=1/0%>
Access /notexists.htm in your site. A blank screen is shown.
Access /default.asp. A divide by zero error is shown, which was also expected in step 3.
Any clues?
Errors will return a status of 500-100, internal server error. So you might want to seperate out the 404 file not found, and 500-100 error pages.

Overrided 404 error page, but it's not being displayed

I've placed a new 404 template file in:
app/Resources/TwigBundle/views/Exception/error404.html.twig
But it's not being shown when 404 is thrown. I've cleared the cache so not sure what else I could do. Any ideas?
Edit: Never mind, apparently it needs to be:
app/Resources/TwigBundle/views/Exception/exception_full.html.twig

symfony - admin 404

I'm trying to create a custom 404 page in my admin when something goes wrong and a 404 is thrown.
In my settings.yml file in:
apps/admin/config/settings.yml
I have the following:
all:
.actions:
# 404 module/action
error_404_module: common
error_404_action: error404
I have the module 'common' in my modules folder and I've defined an action called:
executeError404()
and also the template:
error404Success.php
But for some reason, this action never seems to get called as I've tried an exit(); but it still calls the default 404 error message that symfony throws.
Does anyone have any ideas?
Thanks
The custom 404 page doesn't show when in dev mode. If you change your front controller to the production one you should see it if it's configured correctly.
So rather than going to frontend_dev.php got to frontend.php or index.php depending on your setup.

Resources