-
Notifications
You must be signed in to change notification settings - Fork 384
Description
Describe the bug
I've followed the instructions on the "for browser consumption" page to import the webex sdk into a basic create react app (built from generic webpack config).
I'm getting a Module not found: Error: Can't resolve 'fs' in ".../node_modules/strtok3/lib" error.
I've looked into how to allow webpack/CRA to access fs and the documentation is stating that fs should not be included in browser code. (see here)
Is it expected that the SDK should load inside a react app?
Is there an expectation that webex has access to the fs library?
Should I be adding that library to the browser? (which is difficult as CRA explicitly prevents that)
Is there a work around to not require fs? (eg: not importing the entire webex module, but subsets)
Thanks for your assistance.
To Reproduce
Steps to reproduce the behavior:
I've pushed a stripped down version of a new app for your testing if desired, otherwise see below instructions,
https://github.com/tomBarkerSwitchTelecom/webex-test.
NB: webpack 5 causes a lot of "standard" packages to need to be manually installed which I haven't set out the instructions for below (but have done in the test app). I'll be opening another ticket for that and will link below once I've done that.
npx create-react-app webex-test --template typescriptcd webex-testnpm install --save webex- Add
<script crossorigin src="https://unpkg.com/webex/umd/webex.min.js"></script>toindex.html - Add
const Webex = require("webex");toApp.tsx npm start
Expected behavior
Expect application to be able to load following the installation instructions.
Platform (please complete the following information):
- OS: [iOS]
- Browser [chrome]
- Version [3.4.0]
- Device Type [Desktop]
