Giter VIP home page Giter VIP logo

Comments (13)

ufukomer avatar ufukomer commented on September 24, 2024 4

@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,
});

from stompjs.

kum-deepak avatar kum-deepak commented on September 24, 2024 2

Please try https://stomp-js.github.io/guide/stompjs/rx-stomp/ng2-stompjs/2018/06/29/pollyfils-for-stompjs-v5.html

from stompjs.

mseyfayi avatar mseyfayi commented on September 24, 2024 1

I tried nodejs solution in my react code
and it's worked!!!!!!! (I don't know why :D)
@kum-deepak
thanks

from stompjs.

benodeveloper avatar benodeveloper commented on September 24, 2024 1

@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 😁

from stompjs.

kum-deepak avatar kum-deepak commented on September 24, 2024

TextEncoder and TextDecoder are needed by this library. Please see the following article for details on how to get poly-fills:

https://stomp-js.github.io/guide/stompjs/rx-stomp/ng2-stompjs/2018/06/28/pollyfils-for-stompjs-v5.html

from stompjs.

kum-deepak avatar kum-deepak commented on September 24, 2024

I am closing this, if it is still unresolved, please open a new issue.

from stompjs.

mseyfayi avatar mseyfayi commented on September 24, 2024

@kum-deepak this article page is not found :'(

from stompjs.

mseyfayi avatar mseyfayi commented on September 24, 2024

@kum-deepak
Thanx

from stompjs.

kum-deepak avatar kum-deepak commented on September 24, 2024

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

from stompjs.

mseyfayi avatar mseyfayi commented on September 24, 2024

that doesn't work for me!!!

from stompjs.

ArjunPatidar-numero avatar ArjunPatidar-numero commented on September 24, 2024

@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.

from stompjs.

kum-deepak avatar kum-deepak commented on September 24, 2024

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.

from stompjs.

ArjunPatidar-numero avatar ArjunPatidar-numero commented on September 24, 2024

@madsams Hey which solution you tried for Can't find variable: TextEncoder error can please tell me the process, It'll be helpfull.

from stompjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.