You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "philipchench (via GitHub)" <gi...@apache.org> on 2023/11/17 21:52:40 UTC

[I] Invalid token specified: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. [superset]

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

   We are using the npm package for superset-ui, and after trying to embed a dashboard, we get the following runtime error:
   
   `
   Uncaught runtime errors:
   ×
   ERROR
   Invalid token specified: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
   InvalidTokenError
       at ./node_modules/jwt-decode/build/jwt-decode.esm.js (http://localhost:5001/static/js/bundle.js:6663:15)
       at options.factory (http://localhost:5001/static/js/bundle.js:42540:31)
       at __webpack_require__ (http://localhost:5001/static/js/bundle.js:41948:33)
       at fn (http://localhost:5001/static/js/bundle.js:42197:21)
       at ./node_modules/@superset-ui/embedded-sdk/lib/guestTokenRefresh.js (http://localhost:5001/static/js/bundle.js:693:41)
       at options.factory (http://localhost:5001/static/js/bundle.js:42540:31)
       at __webpack_require__ (http://localhost:5001/static/js/bundle.js:41948:33)
       at fn (http://localhost:5001/static/js/bundle.js:42197:21)
       at ./node_modules/@superset-ui/embedded-sdk/lib/index.js (http://localhost:5001/static/js/bundle.js:754:26)
       at options.factory (http://localhost:5001/static/js/bundle.js:42540:31)
   `
   
   Our code (our dashboards are named Inset but it's the same thing):
   
   `
   import { useEffect } from "react";
   import { embedDashboard } from "@superset-ui/embedded-sdk";
   
   export function SupersetDashboard(props) {
     useEffect(() => {
   
       const getGuestToken = async (token) => {
         const tokenRes = await fetch(
           `our api ... GetInsetBIToken?dashboardID=${token}`,
           {
             method: "POST",
             headers: {
               Accept: "*/*",
             },
           }
         );
         const tokenJSON = await tokenRes.json();
         console.log(tokenJSON.Data);
         return tokenJSON.Data;
       };
   
       embedDashboard({
         id: "sampleid"
         supersetDomain: "sampledomain",
         mountPoint: document.getElementById("inset-container"), // any html element that can contain an iframe
         fetchGuestToken: () => getGuestToken(),
         dashboardUiConfig: {
           hideTitle: true,
           hideTab: true,
           hideChartControls: false,
           filters: {
             expanded: true,
           },
         },
       });
     });
   
     return <div id="inset-container"></div>;
   }
   
   `
   
   ### Environment
   - browser type and version: Google Chrome and Edge
   - superset version: superset version 0.1.0-alpha.10 `
   - node.js version: 16.20.2
   - create-react-app: 5.0.1 (latest)
   
   ### Additional context
   Note: all of this works if we use the SDK and an html page without React. We tried various environments, none worked if we use embedDashboard from the lib directory of the superset node module. The SDK works, but it produces errors in React so we could only use it in a pure html-js environment where there isn't any webpack/babel compilation.
   


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Invalid token specified: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina closed issue #26018: Invalid token specified: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
URL: https://github.com/apache/superset/issues/26018


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Invalid token specified: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on issue #26018:
URL: https://github.com/apache/superset/issues/26018#issuecomment-1986240805

   Closing this issue given the version specified, 0.1.0-alpha.10, and assuming that the problem does not happen on current versions of Superset. Please reopen if that's not the case.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org