-
Notifications
You must be signed in to change notification settings - Fork 346
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
Importing SDK into webpack 5 app requires extra library configuration #3842
Comments
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 Changes in webpack.config
This might be a helpful article - https://gist.github.com/ef4/d2cf5672a93cf241fd47c020b9b3066a |
Thanks for the reply. 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
The text was updated successfully, but these errors were encountered: