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

Whoops! Lost connection to error with npm #658

Open
iutx opened this issue Aug 16, 2024 · 0 comments
Open

Whoops! Lost connection to error with npm #658

iutx opened this issue Aug 16, 2024 · 0 comments

Comments

@iutx
Copy link

iutx commented Aug 16, 2024

Desc

I use

"sockjs-client": "^1.5.1",
"stompjs": "^2.3.3",

to connect websocket

const socket = new SockJS(url);
stompClient = Stomp.over(socket);

stompClient.connect({}, (frame) => {
  console.log('Connected: ' + frame);

  stompClient.subscribe(`/topic/${databaseName}/public`, (messageOutput) => {
    const message = JSON.parse(messageOutput.body);
    console.log(message);
    showMessage(message.sender + ':' + message.content);
  });
});

that throw Whoops! Lost connection to error.

But i import same version "sockjs-client": "^1.5.1" with mini.js

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sockjs.min.js"></script>
const socket = new window.SockJS(url);

all things ok.

It's very confusing to me.
What is the direction of troubleshooting, thanks!

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

1 participant