-
Notifications
You must be signed in to change notification settings - Fork 58
webstomp.over is not a function anymore? #73
Comments
Yeah I am getting the same errors. I thought patch bumps weren't supposed to add breaking changes. |
@Way2nnadi I though too. Ho but maybe I did not do it on purpose... |
@pmeijer could you inspect your |
I'm also running into this issue. If that's any help,
|
It's an Angular application, using TypeScript and Angular CLI (which uses Webpack underneath). Simply upgrading |
The thing is I'm using it already and I do not have this issue. I cannot reproduce it, but I'm not in TS nor Angular environment. Could your try without the index.d.ts shipped in this project, maybe it is outdated? |
I don't think this is a TS issue, because this is a runtime error... Maybe it's an Angular CLI issue, I don't know if the OP is also using Angular CLI? But it's the only library that shows such an issue... Anyway, I did my best to make a reproduction. This is a simple Angular CLI application (generated with const url = 'ws://ponyracer.ninja-squad.com/ws';
const websocket: WebSocket = new WebSocket(url);
const stompClient: Client = Webstomp.over(websocket);
stompClient.connect({ login: null, passcode: null }, () => {
stompClient.subscribe('player/2179', message => {
});
}); This works. Now if I try to update to I hope this helps. |
I can see the bug, but I still dont know why it happens :( In standard build with webpack it does not behave the same. I'll try to fix by moving from webpack to rollup to build the dist files. |
@cexbrayat I just published 1.2.3 hoping it solves the issue without breaking for others people. I saw different weird things in export / ts definition and build. Anyway, waiting for your feedback before closing this. Appreciate your help ;) |
@JSteunou The good news is that it looks like the issue is fixed (no error in the repoduction repo) 🎆 Bad news is that I get:
in another project. So I think you need to type more strictly what you introduced in 35e50a9 to make it perfect 🙂 |
I think something like :
would do the job (the type of VERSIONS can maybe be improved, but that should work) |
Got this When trying default import with |
I used typeof all the way. I'm not a TS expert so if someone wants to make a better index.d.ts I'm taking it |
@JSteunou 👍 I updated my app to 1.2.4 and I have no issues anymore. Thanks for your help! |
Bumping from 1.2.0 and 1.2.2 I stared to get an exception saying webstomp.over is not a function.
The text was updated successfully, but these errors were encountered: