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

The WebSocket Dev UI widget does not connect for nested classes #43534

Closed
cescoffier opened this issue Sep 26, 2024 · 8 comments · Fixed by #43560
Closed

The WebSocket Dev UI widget does not connect for nested classes #43534

cescoffier opened this issue Sep 26, 2024 · 8 comments · Fixed by #43560
Assignees
Labels
Milestone

Comments

@cescoffier
Copy link
Member

Describe the bug

When you click on connect, nothing happens.
The console says:
Uncaught SyntaxError: Failed to execute 'querySelector' on 'DocumentFragment': '#org_acme_QuarkusAiServiceScopes$MyWSEndpoint' is not a valid selector.

I believe it's because my web socket is a nested class.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@cescoffier cescoffier added the kind/bug Something isn't working label Sep 26, 2024
Copy link

quarkus-bot bot commented Sep 26, 2024

/cc @phillip-kruger (devui)

@cescoffier cescoffier changed the title The WebSocket Dev UI widget does not connect The WebSocket Dev UI widget does not connect for nested classes Sep 26, 2024
@phillip-kruger
Copy link
Member

Is this Quarkus Dev ui or langchain4j extension?

@cescoffier
Copy link
Member Author

Quarkus Dev UI.

Basically, if you have a websocket endpoint declared as a static nested class, the generated id is incorrect because of the #

public class Application {

    @WebSocket(path="/ws")
    static class MyWebSocket {
    
         @OnTextMessage
         String echo(String s) { return s; }
    }

}

@mkouba
Copy link
Contributor

mkouba commented Sep 27, 2024

Is this Quarkus Dev ui or langchain4j extension?

I believe that it's a WS Next Dev UI. Will take a look.

@mkouba mkouba self-assigned this Sep 27, 2024
@cescoffier
Copy link
Member Author

The websocket works, it's just the dev ui that compute an invalid javascript it.

@cescoffier
Copy link
Member Author

(BTW, I'm using the nested class technique in presentation to have everything in one file)

@mkouba
Copy link
Contributor

mkouba commented Sep 27, 2024

The websocket works, it's just the dev ui that compute an invalid javascript it.

Yes, I mean the Dev UI part of the WS Next extension...

@mkouba
Copy link
Contributor

mkouba commented Sep 27, 2024

This one-liner fix should help..

@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 27, 2024
mskacelik pushed a commit to mskacelik/quarkus that referenced this issue Oct 2, 2024
@gsmet gsmet modified the milestones: 3.16.0.CR1, 3.15.2 Oct 18, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 21, 2024
bschuhmann pushed a commit to bschuhmann/quarkus that referenced this issue Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants