This article is about fixing Application error a client-side exception has occurred (see the browser console for more information) in ajnart Homarr
  • 30-Jan-2023
Lightrun Team
Author Lightrun Team
Share
This article is about fixing Application error a client-side exception has occurred (see the browser console for more information) in ajnart Homarr

Application error: a client-side exception has occurred (see the browser console for more information) in ajnart Homarr

Lightrun Team
Lightrun Team
30-Jan-2023

Explanation of the problem

Problem:

  • When enabling the calendar and date module in the Docker (version 0.3.0) environment, an error is displayed: “Application error: a client-side exception has occurred (see the browser console for more information).”

Browser and OS:

  • Safari Version 13.1.2 (14609.3.5.1.5) on macOS Mojave.

Error Details:

  • The browser console displays the following error message:

“[Error] TypeError: e.filter((function(e){return”Sonarr”===e.type})).at is not a function. (In ‘e.filter((function(e){return”Sonarr”===e.type})).at(0)’, ‘e.filter((function(e){return”Sonarr”===e.type})).at’ is undefined)”

The issue appears to be with the client-side code, as indicated by the error message “A client-side exception has occurred”. The specific error message “TypeError: e.filter(…).at is not a function” suggests that the “at” method is being called on an object that doesn’t support it. Further information from the stack trace may be necessary to determine the root cause of the issue.

The client-side code is running on Safari Version 13.1.2 on macOS Mojave. The application is running on Docker with version 0.3.0.

Troubleshooting with the Lightrun Developer Observability Platform

Getting a sense of what’s actually happening inside a live application is a frustrating experience, one that relies mostly on querying and observing whatever logs were written during development.
Lightrun is a Developer Observability Platform, allowing developers to add telemetry to live applications in real-time, on-demand, and right from the IDE.

  • Instantly add logs to, set metrics in, and take snapshots of live applications
  • Insights delivered straight to your IDE or CLI
  • Works where you do: dev, QA, staging, CI/CD, and production

Start for free today

Problem solution for Application error: a client-side exception has occurred (see the browser console for more information) in ajnart Homarr

This error message is typically encountered in a web application and suggests that there is an issue with the client-side JavaScript code. To troubleshoot this issue, you can do the following steps:

  1. Open the browser’s console by right-clicking on the page and selecting “Inspect” or “Inspect Element”.
  2. Look for any error messages related to the issue in the console.
  3. Analyze the error message and the source code to identify the root cause of the issue.
  4. Debug the code to resolve the issue.
  5. If you are unable to resolve the issue, consider seeking help from the developer community or the developers of the application.

Other popular problems with Homarr

Problem: CORS (Cross-Origin Resource Sharing) Error

When trying to make API calls from a client-side application, the browser blocks the request due to security reasons. This leads to the “Access-Control-Allow-Origin” error being thrown in the browser console.

Solution:

To resolve this error, the API server needs to include the “Access-Control-Allow-Origin” header in its response, allowing the client-side application to access the API.

Example code in a Node.js server to resolve this error:

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

Problem: Authentication Error

When trying to access protected routes or perform actions that require authentication, a 401 Unauthorized error is thrown. This occurs because the client-side application is not sending the necessary authentication credentials to the API.

Solution:

To resolve this error, the client-side application needs to send the necessary authentication credentials, such as a JSON Web Token (JWT), in the request header.

Example code in a React component to resolve this error:

const headers = {
  "Authorization": `Bearer ${localStorage.getItem("jwt")}`
};

axios.get("/api/protected-route", {headers})
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });

Problem: Missing Route Error

When navigating to a specific route in the client-side application, a 404 Not Found error is thrown. This occurs because the route is not defined on the server.

Solution:

To resolve this error, the route needs to be defined on the server. This can be done using a framework such as Express for Node.js.

Example code in an Express server to resolve this error:

app.get("/api/some-route", (req, res) => {
  res.json({message: "Route found!"});
});

A brief introduction to Homarr

Homarr is an open-source content management system (CMS) built on Laravel PHP framework. It provides an intuitive interface for managing website content, users, and media files. Homarr is designed to be fast, secure and easy to use, making it a popular choice for small to medium-sized websites.

One of the key features of Homarr is its modular architecture, which allows developers to easily extend its functionality by adding custom modules. This is achieved through the use of Laravel’s packages and middleware, making it easy for developers to create custom logic for specific tasks, such as adding custom fields to pages or integrating with third-party APIs. The modular architecture also makes it easy to upgrade or remove modules as needed, without affecting the rest of the application. This flexibility and ease of customization are what make Homarr a popular choice for many developers and website owners.

Most popular use cases for Homarr

  1. Homarr can be used for managing and organizing large amounts of data. Homarr provides APIs and a user interface for users to store, retrieve and manipulate data as per their requirements. The APIs allow for easy integration into custom applications, making it easy for developers to work with Homarr.
  2. Homarr can also be used for automating tasks and workflows. Homarr provides an easy to use UI and APIs that can be used to automate repetitive tasks and manage complex workflows. This can be used to increase efficiency and reduce human errors.
  3. Homarr can also be used for creating custom applications. Homarr provides a flexible platform with APIs and a UI for developers to build custom applications that fit their specific needs. For example, the following code block shows how Homarr can be used to create a custom application that retrieves data from a database and displays it in a UI:
import Homarr

# Connect to Homarr instance
homarr = Homarr.connect(api_key="your_api_key")

# Retrieve data from Homarr database
data = homarr.get("your_database_id")

# Display data in UI
for item in data:
    print(item)
Share

It’s Really not that Complicated.

You can actually understand what’s going on inside your live applications.

Try Lightrun’s Playground

Lets Talk!

Looking for more information about Lightrun and debugging?
We’d love to hear from you!
Drop us a line and we’ll get back to you shortly.

By submitting this form, I agree to Lightrun’s Privacy Policy and Terms of Use.