apurvh opened a new issue, #22800:
URL: https://github.com/apache/superset/issues/22800

   Trying to embed the dashboard using Superset Embedded SDK fails in react app.
   Throws module not found error - `Module not found: Error: Can't resolve 
'@superset-ui/switchboard'`
   
   #### How to reproduce the bug
   
   1. Create a react app with - `npx create-react-app test-superset-emebed-app`
   2. In the App.js, add - 
   `
   import { embedDashboard } from "@superset-ui/embedded-sdk";
   
   
   <div id="superset-container"></div>
    <button onClick={() => {
               console.log("Button clicked");
               const token = "your tocken";
               embedDashboard({
                 id: "1f3ebcef-**",  // given by the Superset embedding UI
                 supersetDomain: "http://**";,
                 mountPoint: document.getElementById("superset-container"), // 
html element in which iframe render
                 fetchGuestToken: () => token,
                 dashboardUiConfig: { hideTitle: true }
               });}}>
   Click me
   </button>
   
   `    
   
   ### Expected results
   
   Embedded dashboard
   
   ### Actual results
   
   Failed to compile.
   
   `
   Module not found: Error: Can't resolve '@superset-ui/switchboard' in 
'/Users/apurva/Dev/test-react-app/node_modules/@superset-ui/embedded-sdk/lib'
   ERROR in ./node_modules/@superset-ui/embedded-sdk/lib/index.js 8:19-54
   Module not found: Error: Can't resolve '@superset-ui/switchboard' in 
'/Users/apurva/Dev/test-react-app/node_modules/@superset-ui/embedded-sdk/lib'
   
   webpack compiled with 1 error
   `
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: chrome (latest)
   - superset version: ` "@superset-ui/embedded-sdk": "^0.1.0-alpha.8"`
   - python version: ``
   - node.js version: `v19.4.0`
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   This pertains to Superset Embedded SDK
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to