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

(net.createConnection is not a function) error in React JS #84

Open
Amin207 opened this issue Jan 26, 2023 · 0 comments
Open

(net.createConnection is not a function) error in React JS #84

Amin207 opened this issue Jan 26, 2023 · 0 comments

Comments

@Amin207
Copy link

Amin207 commented Jan 26, 2023

Hi, using React js and got this error at the beginning. (The options are not right but atleast it could get me a callback error instead of net error.)

const Stomp = require("stomp-client");

const destination = "/queue/someQueueName";
const client = new Stomp("127.0.0.1", 61613, "user", "pass");

export default function StompTest() {
  client.connect(
    function (sessionId) {
      client.subscribe(destination, function (body, headers) {
        console.log(
          "This is the body of a message on the subscribed queue:",
          body
        );
      });

      client.publish(destination, "Oh herrow");
    },
    function (err) {
      console.log(err);
    }
  );
}
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