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

Docs may be outdated; example scripts are not working. #10

Closed
segfall opened this issue Sep 1, 2023 · 13 comments
Closed

Docs may be outdated; example scripts are not working. #10

segfall opened this issue Sep 1, 2023 · 13 comments

Comments

@segfall
Copy link

segfall commented Sep 1, 2023

I tried running the Minimal Example and the Repository Examples but neither seems to work anymore.
The former gives the error:

error: Uncaught SyntaxError: The requested module 'https://deno.land/x/webui/mod.ts' does not provide an export named 'WebUI'
import { WebUI } from "https://deno.land/x/webui/mod.ts";
         ^
    at <anonymous> (file:///path/to/garden/app.js:1:10)

and the latter gives the error:

error: Uncaught (in promise) Error: Could not open library: Could not open library: dlopen(/Users/jim/.deno_webui/ffd9edc4-webui-2.dyn, 0x0005): tried: '/Users/jim/.deno_webui/ffd9edc4-webui-2.dyn' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/jim/.deno_webui/ffd9edc4-webui-2.dyn' (no such file), '/Users/jim/.deno_webui/ffd9edc4-webui-2.dyn' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

My current environment is like so:

deno 1.36.3 (release, aarch64-apple-darwin)
v8 11.6.189.12
typescript 5.1.6
Macbook Pro M2 Venture 13.2.1

Has anyone else encountered this issue?

@segfall segfall changed the title Documentation is outdated? Example documentation may be outdated Sep 1, 2023
@segfall segfall changed the title Example documentation may be outdated Example documentation may be outdated; Examples are not working. Sep 1, 2023
@segfall segfall changed the title Example documentation may be outdated; Examples are not working. Docs may be outdated; example scripts are not working. Sep 1, 2023
@hassandraga
Copy link
Member

Related to this issue

@hassandraga
Copy link
Member

I just tested it on Windows right now:

git clone https://github.com/webui-dev/deno-webui.git
cd deno-webui\examples\hello_world
deno run --allow-all --unstable hello_world.ts

image

@hassandraga
Copy link
Member

I will re-test it on macOS tomorrow.

@segfall
Copy link
Author

segfall commented Sep 1, 2023

Thanks, Hassan. I got around the first issue by following the issue you linked and pulling the repo.

However, the Mac issue seems to be because WebUI expects a different CPU architecture.

@hassandraga
Copy link
Member

You are right, we need to add the ARM64 lib into the repo. I will do it tomorrow.

@jeff-hykin
Copy link
Contributor

Just a friendly bump that most of the stuff in the readme still doesn't run

@rmnoon
Copy link

rmnoon commented Oct 29, 2023

Yep, running into the same stuff. Have it working on Apple Silicon by checking out the tree and using the library directly but the deno.land stuff is out of date. Also FWIW on latest MacOS with Chrome I'm just getting the UI opening in the full browser itself instead of the raw frame.

@hassandraga
Copy link
Member

WebUI does not support Safari app mode yet. Firefox or any Chromium-based browser should be installed first to use app mode. Otherwise, WebUI will try to open the UI in the default macOS browser window, which will be in most cases Safari (Not app-mode).

On the other hand, WebUI v2.4.0 has been released... We will update the Deno-WebUI wrapper soon.

@jeff-hykin
Copy link
Contributor

jeff-hykin commented Nov 1, 2023

Firefox or any Chromium-based browser should be installed first to use app mode

Okay then you probably want to change the Readme.md cause it says

Fully Independent (No need for any third-party runtimes)

If the system needs a browser installed, then I wouldn't really call this library "fully independent". A browser is a third party JavaScript/Wasm runtime.

@AlbertShown
Copy link
Contributor

A browser is a third party

On one side, yes. In another, no. All programs in all OS need hundreds or thousands of libs, drivers, runtime, etc. All those are built-in in the OS, so nobody talks about it because it's already installed. A web browser is one of them.

Conversely, because Deno-webui needs Chromium browsers and not Safari, it is a third party then, as you said.

I suggest adding in the readme that a Chromium-based browser is needed.

@jeff-hykin
Copy link
Contributor

jeff-hykin commented Nov 29, 2023

All I'm saying is the readme should say:

  • No 3rd party runtime needed* (WebUI uses the runtime of the OS's built-in broswer, except on MacOS)

It might seem small, but it has really big implications. Saying "no 3rd party runtime" makes it sound like WebUI is providing the runtime, and that the runtime will be consistent across OS's which isn't the case.

All programs in all OS need hundreds or thousands of libs

(not always true, see cosmopolitan libc) but there is a big difference between needing libc and a broswer. Libc is part of the spec for Mac/Linux/Windows. Browsers are not part of the spec for Linux.

Saying it needs a browser runtime tells me it's potentially unreliable on Linux; which is fine, but very important to know.

And some credit is due, as the readme does talk about the exact libraries used (like gtk), which is great.

On one side, yes. In another, no

Fair enough, I should revise my statement. Browsers are 3rd party runtimes on some OS's. But especially in Docker, and even on Ubuntu, Firefox is not guaranteed, if it exists it's not guaranteed to be in the same place, and even if it's in the same place it can be any version of Firefox, and can be upgraded without upgrading the OS. It's a sometimes-pre-bundled 3rd party runtime.

I suggest adding in the readme that a Chromium-based browser is needed.

It works for Firefox so I don't think this would be accurate.

@hassandraga
Copy link
Member

Honestly, this is not a bad idea, we should add in the readme that a web browser is needed at runtime.

@jeff-hykin
Copy link
Contributor

Also can confirm readme example is working 👌 So this can probably be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants