devika icon indicating copy to clipboard operation
devika copied to clipboard

Issue running the UI with Bun

Open acdundore opened this issue 1 year ago • 11 comments

I'm able to get through all of the setup steps successfully. However, when I open the server address in my browser, the screen is blank. I am running on Windows and have all adblocks turned off in my browser. I should also mention that I have not edited the config.toml file (I plan to modify this in the UI settings as described in the setup instructions).

Here is the output from running devika.py:

(devika) (base) <DIRECTORY>\devika>python devika.py 24.04.03 22:52:08: root: INFO : Initializing Devika... 24.04.03 22:52:08: root: INFO : Initializing Prerequisites Jobs... 24.04.03 22:52:29: root: INFO : Loading sentence-transformer BERT models... 24.04.03 22:52:35: root: INFO : BERT model loaded successfully. 24.04.03 22:52:40: root: INFO : Ollama available 24.04.03 22:52:43: root: INFO : Devika is up and running!

Here is the output after executing bun run dev:

(devika) (base) <DIRECTORY>\devika\ui>bun run dev $ vite dev

VITE v5.2.2 ready in 3084 ms

➜ Local: http://localhost:3000/ ➜ Network: use --host to expose ➜ press h + enter to show help

Any ideas why the UI is not showing up properly? I just pulled the git repo hours ago. Thanks!

acdundore avatar Apr 04 '24 04:04 acdundore

is the browser console throwing any error?

RohitX0X avatar Apr 04 '24 06:04 RohitX0X

Did you install all the new requirements? I also faced the same error, and pip install -r requirements.txt does the trick. Thanks!

obliviousz avatar Apr 04 '24 07:04 obliviousz

Did you install all the new requirements? I also faced the same error, and pip install -r requirements.txt does the trick. Thanks!

Which python version do you use?

Falkonar avatar Apr 04 '24 12:04 Falkonar

is the browser console throwing any error?

@RohitX0X The browser console is not throwing any errors. I also see some HTML in the inspector.

Did you install all the new requirements? I also faced the same error, and pip install -r requirements.txt does the trick. Thanks!

@obliviousz As of the time I posted the original message, I was using the latest requirements.

Which python version do you use?

@Falkonar I am using Python 3.11.

acdundore avatar Apr 04 '24 12:04 acdundore

is the browser console throwing any error?

@RohitX0X The browser console is not throwing any errors. I also see some HTML in the inspector.

Did you install all the new requirements? I also faced the same error, and pip install -r requirements.txt does the trick. Thanks!

@obliviousz As of the time I posted the original message, I was using the latest requirements.

Which python version do you use?

@Falkonar I am using Python 3.11.

I think we need to find how to fix Socket IO in Node JS. I'm able to run UI too but it's blank however I had error after bun run dev

Falkonar avatar Apr 04 '24 13:04 Falkonar

png

Falkonar avatar Apr 04 '24 13:04 Falkonar

@Falkonar do you think this has anything to do with the Python version? I can try a different version if that would help.

acdundore avatar Apr 04 '24 13:04 acdundore

@Falkonar do you think this has anything to do with the Python version? I can try a different version if that would help.

I'm not sure what version it require. Pretty sure that on WSL will work. I'm waiting for somebody to give advice . I have issue on windows 10 with Python 3.10.7 and 3.12.2 as well . And you try 3.11 no luck . There is must something wrong with node.js I think

Falkonar avatar Apr 04 '24 15:04 Falkonar

@Falkonar - FYI, I tried setting up Devika from scratch again, this time using a conda venv (as opposed to uv). I also tried it with Python 3.10. Still having the same issue. I inspected the HTML in my browser when I followed the Bun server link and this was under the body tag. I wonder if it is a problem with my browser? This is not my area of expertise.

  		{
  			__sveltekit_dev = {
  				base: new URL(".", location).pathname.slice(0, -1),
  				env: {}
  			};

  			const element = document.currentScript.parentElement;

  			Promise.all([
  				import("/@fs/some_directory/devika/ui/node_modules/@sveltejs/kit/src/runtime/client/entry.js"),
  				import("/@fs/some_directory/devika/ui/.svelte-kit/generated/client/app.js")
  			]).then(([kit, app]) => {
  				kit.start(app, element);
  			});
  		}

acdundore avatar Apr 04 '24 17:04 acdundore

@Falkonar - FYI, I tried setting up Devika from scratch again, this time using a conda venv (as opposed to uv). I also tried it with Python 3.10. Still having the same issue. I inspected the HTML in my browser when I followed the Bun server link and this was under the body tag. I wonder if it is a problem with my browser? This is not my area of expertise.

  		{
  			__sveltekit_dev = {
  				base: new URL(".", location).pathname.slice(0, -1),
  				env: {}
  			};

  			const element = document.currentScript.parentElement;

  			Promise.all([
  				import("/@fs/some_directory/devika/ui/node_modules/@sveltejs/kit/src/runtime/client/entry.js"),
  				import("/@fs/some_directory/devika/ui/.svelte-kit/generated/client/app.js")
  			]).then(([kit, app]) => {
  				kit.start(app, element);
  			});
  		}

I will try tomorrow with conda mini, can't check now. Try Debian with WSL2 I'm sure that will work, I hope)

Falkonar avatar Apr 04 '24 17:04 Falkonar

hey @Falkonar can you try it out this solution.

resolve: {
    alias: {
      "xmlhttprequest-ssl": "./node_modules/engine.io-client/lib/xmlhttprequest.js"
    }
  }

image

add this to vite.config.js

ARajgor avatar Apr 04 '24 17:04 ARajgor

I don't manage too, I'm on WIndows. Tried with bun and pnpm

Volko76 avatar Apr 05 '24 11:04 Volko76

When I try to build I get : Could not detect a supported production environment. See https://kit.svelte.dev/docs/adapters to learn how to configure your app to run on the platform of your choosing

Volko76 avatar Apr 05 '24 11:04 Volko76

I ended up replicating the same steps I took, but in WSL and it worked perfectly. So this must be a problem associated with windows.

acdundore avatar Apr 05 '24 12:04 acdundore

I'm able to get through all of the setup steps successfully. However, when I open the server address in my browser, the screen is blank. I am running on Windows and have all adblocks turned off in my browser. I should also mention that I have not edited the config.toml file (I plan to modify this in the UI settings as described in the setup instructions).

Here is the output from running devika.py:

(devika) (base) \devika>python devika.py 24.04.03 22:52:08: root: INFO : Initializing Devika... 24.04.03 22:52:08: root: INFO : Initializing Prerequisites Jobs... 24.04.03 22:52:29: root: INFO : Loading sentence-transformer BERT models... 24.04.03 22:52:35: root: INFO : BERT model loaded successfully. 24.04.03 22:52:40: root: INFO : Ollama available 24.04.03 22:52:43: root: INFO : Devika is up and running!

Here is the output after executing bun run dev:

(devika) (base) \devika\ui>bun run dev $ vite dev VITE v5.2.2 ready in 3084 ms ➜ Local: http://localhost:3000/ ➜ Network: use --host to expose ➜ press h + enter to show help

Any ideas why the UI is not showing up properly? I just pulled the git repo hours ago. Thanks!

I was having the same issue. What fixed it for me was installing node.js, after that it works.

clusterpj avatar Apr 07 '24 00:04 clusterpj

I'm able to get through all of the setup steps successfully. However, when I open the server address in my browser, the screen is blank. I am running on Windows and have all adblocks turned off in my browser. I should also mention that I have not edited the config.toml file (I plan to modify this in the UI settings as described in the setup instructions). Here is the output from running devika.py:

(devika) (base) \devika>python devika.py 24.04.03 22:52:08: root: INFO : Initializing Devika... 24.04.03 22:52:08: root: INFO : Initializing Prerequisites Jobs... 24.04.03 22:52:29: root: INFO : Loading sentence-transformer BERT models... 24.04.03 22:52:35: root: INFO : BERT model loaded successfully. 24.04.03 22:52:40: root: INFO : Ollama available 24.04.03 22:52:43: root: INFO : Devika is up and running!

Here is the output after executing bun run dev:

(devika) (base) \devika\ui>bun run dev $ vite dev VITE v5.2.2 ready in 3084 ms ➜ Local: http://localhost:3000/ ➜ Network: use --host to expose ➜ press h + enter to show help

Any ideas why the UI is not showing up properly? I just pulled the git repo hours ago. Thanks!

I was having the same issue. What fixed it for me was installing node.js, after that it works.

same here. installing Node.js helped me

krishnaramadas avatar Apr 09 '24 18:04 krishnaramadas

Refer the latest installation guide. Install node js and bun, run it a clean install.

ARajgor avatar Apr 16 '24 03:04 ARajgor