Closed omars94 closed 5 years ago
TextEncoder and TextDecoder are needed by this library. Please see the following article for details on how to get poly-fills:
I am closing this, if it is still unresolved, please open a new issue.
@kum-deepak this article page is not found :'(
@kum-deepak Thanx
For react native, please also check https://stomp-js.github.io/workaround/stompjs/rx-stomp/ng2-stompjs/2019/06/10/react-native-null-chopping-issue.html
that doesn't work for me!!!
I tried nodejs solution in my react code and it's worked!!!!!!! (I don't know why :D) @kum-deepak thanks
@kum-deepak thanks for the link @madsams thanks for telling where to focus :)
React Native already supports WebSocket thus we only need to add text-encoder to global TextEncoder, TextDecoder objects:
const TextEncodingPolyfill = require('text-encoding');
Object.assign(global, {
TextEncoder: TextEncodingPolyfill.TextEncoder,
TextDecoder: TextEncodingPolyfill.TextDecoder,
});
@ufukomer @kum-deepak I'm getting the same Can't find variable: TextEncoder
when adding the package npm install jose
for key generation. How can I resolve my project is in react native expo.
@ufukomer Your answer is not clear to me.
I do not use React Native myself. Please check https://stomp-js.github.io/guide/stompjs/rx-stomp/ng2-stompjs/pollyfils-for-stompjs-v5.html#in-react-native which is based on information as reported by others.
@madsams Hey which solution you tried for Can't find variable: TextEncoder
error can please tell me the process, It'll be helpfull.
@kum-deepak thanks for the link @madsams thanks for telling where to focus :)
React Native already supports WebSocket thus we only need to add text-encoder to global TextEncoder, TextDecoder objects:
const TextEncodingPolyfill = require('text-encoding'); Object.assign(global, { TextEncoder: TextEncodingPolyfill.TextEncoder, TextDecoder: TextEncodingPolyfill.TextDecoder, });
this solved the problem, thank you 😁
I am using Stompjs to connect with Apache ActiveMQ and Spring Server but when I run application I receive a console warning message and after I navigate to another Screen with lots of data I receive this error non-stop as if it went to a loop.
Error:
I believe this has to do with the package rather than my code