-
Notifications
You must be signed in to change notification settings - Fork 344
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
Difficulties importing Webex sdk into create-react-app #3841
Comments
bug ticket for dependencies see here: #3842 |
Thanks for raising this issue @tomBarkerSwitchTelecom . We'll take a look at this and get back shortly. |
Replied at #3842 |
Thanks for your reply in 3842 (and here) This issue is slightly different as the temporary workaround in the other ticket doesn't work for the fs library as it is explicitly not allowed in the browser which is why I raised this one separately. The other ticket is a "this would be nice to have so that others can easily use this library" whereas this ticket is actually blocking being able to use the sdk in the browser. |
For fs, you can try putting false as the resolution. Below is the fallback object that I am using resolve: { |
adding that fallback option requires the application to be ejected from create web app. |
Hi @tomBarkerSwitchTelecom , We have also created an internal ticket to track this and the team will pick this up in the coming month |
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 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
Expect application to be able to load following the installation instructions.
Screenshots
Platform (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: