-
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
Twilio webrtc library is causing compilation error in webpack 5 #1242
Comments
Twillio is using Node JS native The issue here is that prior to v5 webpack used to include browser polyfills for Node JS modules - with version 5 this behaviour has ben removed. To fix this issue just install the npm i util Another note is that Twillio is also accessing the "global" npm i process and add a new plugin to your webpack config {
...
plugins: [
...
new webpack.ProvidePlugin({ process: 'process' }),
]
} More info here https://webpack.js.org/blog/2020-10-10-webpack-5-release/#changes-to-the-structure |
Ok, great, thanks for confirming those two things. I will use this workaround though wouldn't it be better if these weren't dependencies in the long run? |
@ajorkowski This should be solved once the SDK dependency Thanks, Manjesh |
We're hitting this issue with Issues are resolved if we revert to Webpack4, but using Webpack5 solves a host of other unrelated issues for our project. |
I'm having the same problem now attempting to upgrade to Angular 12 which uses WebPack 5 now. This fixed the main build npm i -S util Adding the code below to (window as any).global = window;
(window as any).process = {
env: { DEBUG: undefined },
}; |
I really wish this was updated and worked out of the box with no node polyfils |
Echoing @niemyjski above - it would be great for Twilio to fix this issue - having to manage polyfills for integration here is really frustrating just to get the out of the box software working - I've talked with Twilio support and they've been mostly unhelpful - this is a missed opportunity for Twilio business, please fix the 2.1.0 Javascript SDK |
This is being tracked by an internal task now. (VIDEO-8609) |
@LaurynasGr solution worked for me after I updated a |
Hi folks, Happy to announce that the latest release 2.21.1 fixes this issue. Please give it a spin and let us know if you're still seeing any issues! Thank you for all of your patience, |
process is not defined if I import connect in an electron app. I don't think this was fixed |
thank you for the prompt reply but I'm getting the same error. going to try integrating daily.co or agora |
or sensitive account information (API keys, credentials, etc.) when reporting this issue.
Code to reproduce the issue:
Expected behavior:
Should not cause a compilation error in webpack 5. The underlying problem is that the chrome.js file is importing 'utils' which is a node.js core module and webpack is not including these anymore. Ideally there wouldn't be a utils import, but I guess I can work around this...
Actual behavior:
The text was updated successfully, but these errors were encountered: