Skip to content
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

[FIX] Docker version: Application error: a client-side exception has occurred (see the browser console for more information). #881

Open
3 of 14 tasks
saccohuo opened this issue Aug 5, 2024 · 14 comments
Labels
docker fix Fix something that isn't working as expected

Comments

@saccohuo
Copy link

saccohuo commented Aug 5, 2024

Describe the bug

Open localhost:42110, after a flash of some window, then get the blank page with error Application error: a client-side exception has occurred (see the browser console for more information).

In the console, shows fd9d1056-2b978342deb60015.js:1 Error: <svg> attribute height: Expected length.

Screenshots

image

Platform

  • Server:
    • Cloud-Hosted (https://app.khoj.dev)
    • Self-Hosted Docker
    • Self-Hosted Python package
    • Self-Hosted source code
  • Client:
    • Obsidian
    • Emacs
    • Desktop app
    • Web browser
    • WhatsApp
  • OS:
    • Windows
    • macOS
    • Linux
    • Android
    • iOS

If self-hosted

  • Server Version [e.g. 1.0.1]: I cannot get the version.

Additional context

Add any other context about the problem here.

@saccohuo saccohuo added the fix Fix something that isn't working as expected label Aug 5, 2024
@rogerc66
Copy link

rogerc66 commented Aug 6, 2024

Same here

`The error messages you provided indicate several issues related to JavaScript and possibly an associated framework that might not be named or described in your question. Here are some explanations for each of these errors:

SVG Attribute Error:
attribute height: Expected length, "auto"

This error is thrown because when you define height on an element using an attribute (such as height="auto"), JavaScript tries to read the value of height. If height is defined with a string ('auto') instead of a numeric value, this throws an error since it's not recognized as a number or a length in JavaScript.

JS TypeError:
TypeError: Cannot read properties of undefined (reading 'icon')

This typically happens when your code attempts to access the icon property of an object that is undefined, null, or has no such property. This might be due to:

The icon variable being not properly set before use.
An issue with asynchronous operations where dependencies are not fully loaded when expected, and thus certain variables are null.
Additional Errors (TypeScript Errors):
The additional errors seem to stem from an older TypeScript version (7023-52c1be60135eb057.js file), which might have compatibility or type issues with newer components or frameworks. Here's how you can address them:

Addressing SVG Attribute:
Ensure that if auto is intended to be treated as a string and used for styling purposes, your attribute should be set like this instead:

If it needs to define an actual size (for example, in pixels), ensure the value follows this format: Addressing JS Type Errors: Check that all components you are trying to access have been initialized properly. If these issues happen in a part of your code that relies on asynchronous operations like fetching data or loading modules, make sure the async processes complete before accessing them:

await Promise.resolve(); // This is an empty promise and waits until it's resolved.
Or using async/await directly:

async function init() {
const icon = await loadIcon();
// Use icon here...
}

init();
Addressing TypeScript Issues:
If you're still seeing issues related to TypeScript, ensure that all imported types are correctly specified and that your code doesn't rely on features that are not supported in your version of TypeScript. Upgrading to the latest stable version might solve these issues if it includes fixes for older features.

Additionally, updating dependencies or frameworks (if any) could resolve compatibility issues between your codebase and its components. Always ensure that you're using libraries or frameworks up to date with your project's requirements.

If specific lines of code were intended to be shared but not provided, I would need those exact pieces of code to provide more tailored solutions. However, based on the context given by the errors themselves, these suggestions should help resolve the issues mentioned above.`

@ajikmr
Copy link

ajikmr commented Aug 8, 2024

Hello.
I am also getting same error. A flash of correct screen, followed by error message being displayed.

Pasting console log below:

Screenshot 2024-08-08 at 5 52 24 PM

/api/settings?detailed=true:1

   Failed to load resource: the server responded with a status of 403 (Forbidden)

fd9d1056-2b978342deb60015.js:1 Error: attribute height: Expected length, "auto".
eK @ fd9d1056-2b978342deb60015.js:1
/api/v1/user:1

   Failed to load resource: the server responded with a status of 403 (Forbidden)

7023-52c1be60135eb057.js:1 TypeError: Cannot read properties of undefined (reading 'icon')
at page-36c7dd2d51d747e5.js:1:22255
at Array.map ()
at page-36c7dd2d51d747e5.js:1:22238
at aW (fd9d1056-2b978342deb60015.js:1:73244)
at oe (fd9d1056-2b978342deb60015.js:1:84685)
at ol (fd9d1056-2b978342deb60015.js:1:85323)
at or (fd9d1056-2b978342deb60015.js:1:85207)
at ol (fd9d1056-2b978342deb60015.js:1:86268)
at or (fd9d1056-2b978342deb60015.js:1:85207)
at ol (fd9d1056-2b978342deb60015.js:1:86268)

@PiyushDixit96
Copy link

Describe the bug

Open localhost:42110, after a flash of some window, then get the blank page with error Application error: a client-side exception has occurred (see the browser console for more information).

In the console, shows fd9d1056-2b978342deb60015.js:1 Error: <svg> attribute height: Expected length.

Screenshots

image

Platform

* Server:
  
  * [ ]  Cloud-Hosted (https://app.khoj.dev)
  * [x]  Self-Hosted Docker
  * [ ]  Self-Hosted Python package
  * [ ]  Self-Hosted source code

* Client:
  
  * [ ]  Obsidian
  * [ ]  Emacs
  * [ ]  Desktop app
  * [x]  Web browser
  * [ ]  WhatsApp

* OS:
  
  * [x]  Windows
  * [ ]  macOS
  * [ ]  Linux
  * [ ]  Android
  * [ ]  iOS

If self-hosted

* Server Version [e.g. 1.0.1]: I cannot get the version.

Additional context

Add any other context about the problem here.

Hello.
I am also getting same error.

@PiyushDixit96
Copy link

issue fix update this value in docker-compose.yml
KHOJ_DEBUG=True
and upgrade the build
docker-compose up --build

please try this

@rogerc66
Copy link

rogerc66 commented Aug 9, 2024

issue fix update this value in docker-compose.yml KHOJ_DEBUG=True and upgrade the build docker-compose up --build

please try this

No luck, still get the same error after rebuild, after a quick flash of normal page, error page kicks in

@Miskina
Copy link

Miskina commented Aug 9, 2024

Hello I am having the same problem on Debian Bookworm (self-hosting with Docker).
It seems the problem is in the page.tsx:114 file of the web frontend. Specifically one of the agents in the agents array seems to be undefined which in turn causes the error. I'm not sure what the root cause of it is, but modifying the code from:

        const agentIcons = agents.map(
            (agent) =>
                getIconFromIconName(agent.icon, agent.color) || (
                    <Image
                        key={agent.name}
                        src={agent.avatar}
                        alt={agent.name}
                        width={50}
                        height={50}
                    />
                ),
        );

to:

        const agentIcons = agents.filter(agent => agent !== null && agent !== undefined).map(
            (agent) =>
                getIconFromIconName(agent.icon, agent.color) || (
                    <Image
                        key={agent.name}
                        src={agent.avatar}
                        alt={agent.name}
                        width={50}
                        height={50}
                    />
                ),
        );

seems to work. Of course you need to make the docker-compose build from source instead of pull the image for the changes to take effect.

@sabaimran
Copy link
Member

Hey folks! Sorry about this, let me push a fix for this. This should also be resolved if you setup a chat model configuration and restart your server. Thanks for the root cause discovery, @Miskina !

@rogerc66
Copy link

Hey folks! Sorry about this, let me push a fix for this. This should also be resolved if you setup a chat model configuration and restart your server. Thanks for the root cause discovery, @Miskina !

Hi, Sabi

Can you please tell us how to setup a chat model config in docker compose? by adding a environment parameter or what ? Thank you.

@saccohuo
Copy link
Author

@sabaimran Hi, the 1.20.4 version solves the problem, but I get Bad Request (400) when I visit http://<myip>:42110/server/admin.

@rogerc66
Copy link

@sabaimran Hi, the 1.20.4 version solves the problem, but I get Bad Request (400) when I visit http://<myip>:42110/server/admin.

I'm having the same problem, blank 400 page for /server/admin

@saccohuo
Copy link
Author

@sabaimran Hi, could you please fix this problem? Many thanks.

@sabaimran
Copy link
Member

sabaimran commented Aug 24, 2024

I'll make some time to look into it today or tomorrow @saccohuo . You're able to load the rest of the app, right? And are you able to load it on localhost, or is it always returning a bad request 400? Some more details about your setup will be helpful to debug.

@saccohuo
Copy link
Author

saccohuo commented Aug 25, 2024

I'll make some time to look into it today or tomorrow @saccohuo . You're able to load the rest of the app, right? And are you able to load it on localhost, or is it always returning a bad request 400? Some more details about your setup will be helpful to debug.我会在今天或明天抽时间来看看这个问题 @saccohuo。你能加载应用的其他部分吗?你能在 localhost 上加载吗,还是总是返回错误请求 400?关于你的设置的更多细节将有助于调试。

@sabaimran After Application error: a client-side exception has occurred (see the browser console for more information). problem solved, I get 400 at http://<myip>:42110/server/admin.
I cannot set the model, so I cannot do anything to it.

@saccohuo
Copy link
Author

saccohuo commented Sep 3, 2024

@sabaimran Hi, is any update?

@debanjum debanjum added docker fix Fix something that isn't working as expected and removed fix Fix something that isn't working as expected labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker fix Fix something that isn't working as expected
Projects
None yet
Development

No branches or pull requests

7 participants