-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Object(...) is not a function at Object.randomInt #797
Comments
Error happens at this code in the browser:
|
the problem seems to be that in browser there is no crypto module available. I tried various ways to polyfill it but every attempt failed |
Did you try https://www.npmjs.com/package/rollup-plugin-polyfill-node? this specifically includes polyfil for the crypto package. |
Yes I did. That didn't work either. It does make an empty If I am not able to fix this problem by next 2 days we will have no choice but to look for a Pusher alternative. |
Getting the same error, any fix available? |
@sambhav-gore did you find a solution? |
@Gabotron-ES No I did not. We are planning to move to Ably now because of this. |
So because of this bug, pusher is basically unable to work? lol such a a joke |
@Gabotron-ES well, there is probably a fix or a workaround but I am too tied up with other development work plus my client doesn't have a lot of budget or time for me to research/fix. So basically 2-3 months ago he told me that if it works within next 2 days we fix or we move to a different provider (Ably). Since then we have parked the upgrade work for now which we will be taking up again in next month. Since I am personally happy with Pusher, I will give it one last try in the next month. |
I see, good lucj and if you come up with a fix please notify us! |
Same here... I tried with |
Do you want to request a feature or report a bug?
Report a Bug
What is the current behavior?
When creating a new instance I see the following error in browser console:
If the current behavior is a bug, please provide the steps to reproduce and
if possible a minimal demo of the problem via https://jsfiddle.net or similar.
What is the expected behavior?
Pusher to intialize and work correctly
Which versions of Pusher, and which browsers / OS are affected by this issue?
Did this work in previous versions of Pusher? If so, which?
I tried many versions 7.4.0, 8.0.2 and 8.4.0-rc2
** MORE DETAILS
It is a sveltekit app which use vite.
It was working fine with sveltekit 1.x vite 4.x but now I need to upgrade.
The biggest difference is that the support for node modules was dropped, I am using the polyfill node modules from
vite-plugin-node-polyfills
Following is my entire vite.config.ts
I was struggling with this for a while so I tried many different things that I found in answers in stackoverflow.
I will highly appreciate any help. or a working sveltekit example if possible.
The text was updated successfully, but these errors were encountered: