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

v2.4.4 - setFileHandler not working with .js files #37

Open
7flash opened this issue Dec 6, 2023 · 2 comments
Open

v2.4.4 - setFileHandler not working with .js files #37

7flash opened this issue Dec 6, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@7flash
Copy link
Contributor

7flash commented Dec 6, 2023

Reproduce following example:

import { WebUI } from "https://deno.land/x/webui@2.4.4/mod.ts";

const myWindow = new WebUI();

myWindow.setFileHandler((myUrl: URL) => {
  console.log(myUrl);
  if (myUrl.pathname === '/app.js') return "console.log('hello from client')"
  throw new Error(`uknown request "${myUrl.pathname}""`)
})

myWindow.show(
  `<html>
        <script src="webui.js">/script>
        <script src="app.js"></script>
     </html>`
)

await WebUI.wait();

Expected to see something in terminal and browser console, or at least the error, but unfortunately nothing happens.

@AlbertShown
Copy link
Contributor

That's true. It's not working. It works fine in the C webui core, but not in the Deno wrapper.

@hassandraga hassandraga added the bug Something isn't working label Dec 7, 2023
@7flash
Copy link
Contributor Author

7flash commented Dec 11, 2023

Seems it's never getting to execute setFileHandler, but I'm not sure might be some deeper issues preventing logging, any idea how to debug further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants