-
Notifications
You must be signed in to change notification settings - Fork 217
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
Crashes on missing process.env
#1746
Comments
Hey @Dosant are you seeing this on Angular only? |
@charliesantos, I haven't tried to reproduce outside my app which is angular. I believe it is possible to come up with a minimal webpack config where this would fail without angular |
@Dosant ok no problem. We are in progress of investigating this issue. |
Hi @Dosant, I'm currently investigating this issue and I was wondering if you could provide more details on how to repro this. Perhaps a repo or a config set up may be useful. I've currently tried to reproduce this using Angular 12 using a fresh project (created using Thank you! |
Hi @PikaJoyce, Here is the repro starting from Starting the app with
I believe this is not angular build specific issue, but can be also reproduced with a simpler webpack config (didn't try) |
Hey @Dosant! Thank you so much for that info. So I cloned your repository and actually ran it. I still wasn't able to repro this. The only other thing I can think of is perhaps it's a difference in node versions? I'd love to be able to dig a bit deeper if it's possible. I'll include a screen shot of what I get when running start on your repo. |
@PikaJoyce, the error occurs in runtime, so you have to open the app |
I am seeing this using esbuild as well. The application compiles successfully however I receive a |
In the meantime, here's a workaround to unblock you while we continue to work on a more permanent solution:
While this is not a permanent solution, it gets the app to run error free for the time being. Thank you for your patience. We hope to get this issue resolved soon. Best, |
Thank you @PikaJoyce! I've been using @esbuild-plugins/node-modules-polyfill for now in order to polyfill the required module for now. |
This problem surfaces also when using vite. Since vite doesn't use |
got the same issue with vite. hope this be priority |
Hey folks, A quick update! This PR was recently merged and will go through several rounds of testing before a full release. Looking forward to getting this into everyones hands! Best, |
Hi everyone, The fix for this issue has been resolved in the most recent release. Please check it out and let me know if there are any further issues. I will now be closing this issue, but please do feel free to continue the conversation here or open another issue with us. Best, |
or sensitive account information (API keys, credentials, etc.) when reporting this issue.
Actual behavior:
twilio-video.js since 2.21.0, 2.21.1 expects
process.env
to be available globally. Otherwise it fails with an exception during import.Expected behavior:
process.env
shouldn't be required in browser fortwilio-video
to work or should be documented as a requirementApparently the root cause is this code:
twilio-video.js/lib/webrtc/rtcpeerconnection/chrome.js
Line 6 in 352ebf3
Where it imports and bundle node module
util
that assumes execution in node environment. This fails in user-land runtime if an app's bundler doesn't supply necessary polyfills.And the crash in the browser happens on this line: https://github.com/browserify/node-util/blob/ad9dbe0df07655a38f0f8fc8feaeccb965d207e7/util.js#L109-L116
Software versions:
The text was updated successfully, but these errors were encountered: