stream-chat-js
stream-chat-js copied to clipboard
TypeError: Cannot read properties of undefined (reading 'bind')
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)
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 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 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 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
Hey @nayebare the code you have shared takes us to a 404 not found page. Still facing this issue?
hey @khushal87, @vanGalilea and @madsroskar I have made the repository public thank you
@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.