stream-chat-js icon indicating copy to clipboard operation
stream-chat-js copied to clipboard

TypeError: Cannot read properties of undefined (reading 'bind')

Open nayebare opened this issue 2 years ago • 2 comments

Hi, i need someone to kindly look into this error.

let  StreamChat = require("stream-chat").StreamChat;

../node_modules/stream-chat/dist/index.js:1284
    return crypto.getRandomValues.bind(crypto);
                                  ^

TypeError: Cannot read properties of undefined (reading 'bind')
    at ../node_modules/stream-chat/dist/index.js:1284:35
    at Object.<anonymous> (../node_modules/stream-chat/dist/index.js:1290:2)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/index.js:6:19)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)

nayebare avatar Jun 18 '22 01:06 nayebare

Hi, @nayebare. I'm not able to reproduce this, would you be able to provide a minimal example that reproduces the issue? Any more information you could give about the specific environment would help as well. For example, which version of stream-chat are you using? Which version of NodeJS are you using?

madsroskar avatar Jun 21 '22 14:06 madsroskar

@madsroskar kindly replicate the error using this code the goal is to run the code as serverless while testing it locally https://github.com/nayebare/create-getstream-node-test

nayebare avatar Jun 21 '22 18:06 nayebare

@nayebare does this issue still occur?

If yes we would like to pinpoint this issue as fast as possible, we would like to ask you to share a minimalistic repo where the problem is reproduced.

Please then share a Github repo with us, where we can explore the issue ourselves.

vanGalilea avatar Aug 18 '22 10:08 vanGalilea

@vanGalilea kindly replicate the error using this code the goal is to run the code as serverless while testing it locally https://github.com/nayebare/create-getstream-node-test

nayebare avatar Aug 18 '22 10:08 nayebare

Hey @nayebare the code you have shared takes us to a 404 not found page. Still facing this issue?

khushal87 avatar Sep 15 '22 10:09 khushal87

hey @khushal87, @vanGalilea and @madsroskar I have made the repository public thank you

nayebare avatar Sep 15 '22 11:09 nayebare

@nayebare, thanks for sharing this repo. We've managed to reproduce this issue and currently working on a fix that will support node v16 and higher versions.

Until then, you can use node v17.4.0 or higher.

vanGalilea avatar Oct 11 '22 09:10 vanGalilea