Open tomBarkerSwitchTelecom opened 1 month ago
Thanks for raising this bug @tomBarkerSwitchTelecom. We'll take a look at this shortly. I see both the issues #3841 and this one are related.
@tomBarkerSwitchTelecom, webpack > 5 removed the ability to automatically polyfill node APIs, because of this we have to install each polyfill and add them as resolve.fallback in webpack.config.js.
So if we have to use os,
Changes in package.json
"os-browserify": "0.3.0"
//devDependency
Changes in webpack.config
resolve:{
fallback:{
os: require.resolve('os-browserify'),
This might be a helpful article - https://gist.github.com/ef4/d2cf5672a93cf241fd47c020b9b3066a
Thanks for the reply. I originally went through that article and that was how i found the work around I suggested in the ticket. The problem with the solution in the ticket is that it requires "ejecting" the create react app which is a pretty nuclear solution, (but admittedly, ejecting isn't required for the solution I found).
Given that webe-js-sdk is designed for use in the browser is there an appetite to move to consuming the browser based versions of these dependencies and explicitly auto add them to the package lock so that this work around (and ejecting) isn't required?
@tomBarkerSwitchTelecom - we have created an internal ticket and the team will pick it up in the coming month.
Describe the bug When importing the SDK into a webpack 5 application there are underlying libraries that are no longer included as standard (for browser) which need require modifying the links to the libraries.
Is this expected?
libraries affected:
To Reproduce Steps to reproduce the behavior:
npx create-react-app webex-test --template typescript
cd webex-test
npm install --save webex
<script crossorigin src="https://unpkg.com/webex/umd/webex.min.js"></script>
toindex.html
const Webex = require("webex");
toApp.tsx
npm start
Expected behavior SDK to import the underlying libraries it requires.
Workaround Installing a browser version of the library and then "linking" it in the package.json seems to solve these issues. see this example app https://github.com/tomBarkerSwitchTelecom/webex-test.
Screenshots
Platform (please complete the following information):
Additional context