My type of application is Client-side web app, SPA, Javascript.
The following description, what is the problem I encountered using @ringcentral/sdk? and how I solved the problem?
Problem
I installed @ringcentral\sdk in application based on Angular 13 and Webpack 5. While building app throwing below error message and looking for help:
./node_modules/@ringcentral/sdk/lib/http/Client.js:73:22-44 - Error: Module not found: Error: Can't resolve 'querystring' in 'D:\2022-Projects\rc-sms-app\node_modules\@ringcentral\sdk\lib\http'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
- install 'querystring-es3'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "querystring": false }
./node_modules/@ringcentral/sdk/lib/platform/Platform.js:82:15-32 - Error: Module not found: Error: Can't resolve 'crypto' in 'D:\2022-Projects\rc-sms-app\node_modules\@ringcentral\sdk\lib\platform'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
./node_modules/@ringcentral/sdk/lib/platform/Platform.js:83:22-44 - Error: Module not found: Error: Can't resolve 'querystring' in 'D:\2022-Projects\rc-sms-app\node_modules\@ringcentral\sdk\lib\platform'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
- install 'querystring-es3'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "querystring": false }
Solution
Install @angular-builders/custom-webpack as a dev dependency
My type of application is Client-side web app, SPA, Javascript.
The following description, what is the problem I encountered using @ringcentral/sdk? and how I solved the problem?
Problem
I installed @ringcentral\sdk in application based on Angular 13 and Webpack 5. While building app throwing below error message and looking for help:
Solution
Expect
Hope this helps developers who encounter similar problems. 😃