Danai Chronopoulou
01/11/2024, 9:23 AMDashboard
in my react application by following these instructions and getting the error
Uncaught Invariant Violation: useBackendStrict: IAnalyticalBackend must be defined. Either pass it as a parameter or make sure there is a BackendProvider up the component tree.
Danai Chronopoulou
01/11/2024, 9:25 AMconst GoodDataWorkspace: FC<GoodDataWorkspaceProps> = ({ token, workspace, selectedDashboard }) => {
const backend = tigerFactory()
.onHostname(process.env.REACT_APP_GOODDATA_URL)
.withAuthentication(new TigerTokenAuthProvider(token));
return (
<BackendProvider backend={backend}>
<WorkspaceProvider workspace={workspace}>
<GooddataDashboard selectedDashboard={selectedDashboard} />
</WorkspaceProvider>
</BackendProvider>
);
};
and I also have all relevant dependencies in package.json
"@gooddata/api-client-tiger": "8.12.2",
"@gooddata/sdk-backend-tiger": "8.12.2",
"@gooddata/sdk-model": "8.12.2",
"@gooddata/sdk-ui": "8.12.2",
"@gooddata/sdk-ui-all": "8.12.2",
"@gooddata/sdk-ui-charts": "8.12.2",
"@gooddata/sdk-ui-dashboard": "8.12.2",
"@gooddata/sdk-ui-ext": "8.12.2",
"@gooddata/sdk-ui-geo": "8.12.2",
"@gooddata/sdk-ui-kit": "^8.12.1",
"@gooddata/sdk-ui-pivot": "^8.12.1",
Danai Chronopoulou
01/11/2024, 9:33 AMRadek Novacek
01/11/2024, 9:51 AMDanai Chronopoulou
01/11/2024, 9:56 AMconst backend = tigerFactory()
.onHostname(process.env.REACT_APP_GOODDATA_URL)
.withAuthentication(new ContextDeferredAuthProvider(redirectToTigerAuthentication));
Radek Novacek
01/11/2024, 9:58 AMDanai Chronopoulou
01/11/2024, 10:00 AMRadek Novacek
01/11/2024, 10:07 AMDanai Chronopoulou
01/11/2024, 10:10 AMDanai Chronopoulou
01/19/2024, 2:35 PMtypescript: "^4.7.4"
react: "^17.0.2"
node: v14.21.3
When attempting to render those dashboard components, we are encountering the issue as seen in the image:Konstantinos Koroneos
01/23/2024, 8:26 AMDanai Chronopoulou
01/24/2024, 2:36 PMRadek Novacek
01/24/2024, 2:38 PMRadek Novacek
01/26/2024, 2:25 PMRadek Novacek
01/29/2024, 8:42 AMBackend and workspace entities are not transfered via contexts to the inner components which consume them. Easiest fix for me was to propagate them manually as a prop to the Dashboard component
```const GooddataDashboard: FC<GooddataDashboardProps> = ({ selectedDashboard }) => {
const classes = useStyles();
// take entities from context of this app
const backend = useBackendStrict();
const ws = useWorkspaceStrict();
// propagate them to Dashboard component via props
return selectedDashboard ? (
<Dashboard dashboard={idRef(selectedDashboard.id)} backend={backend} workspace={ws}/>
) : null;
};```
Then I end up on 401 error for all requests because I expect provided token is not valid.
I would honestly upgrade react, node and then UI SDK too in their project.Essentially, the above suggestion would be a way to make this work for your current setup, though I do agree with my colleague that if it's at all possible, working with more up-to-date versions of everything is a good idea π
Danai Chronopoulou
01/29/2024, 11:57 AMRadek Novacek
01/31/2024, 8:24 AMIAnalyticalBackend must be defined
π
Danai Chronopoulou
01/31/2024, 8:45 AMuseBackEndStrict
in the first error and the AttributeFilter
in the second. Also be aware that by implementing the fix you recommended and by giving a valid token, all apis worked fine and then this "new" error came upRadek Novacek
01/31/2024, 8:48 AMRadek Novacek
02/05/2024, 10:50 AMDanai Chronopoulou
02/05/2024, 1:56 PM8.12.3
β’ Deleted node_modules
and yarn.lock
β’ Ran yarn install
While starting the project with yarn start
, I encountered numerous TypeScript errors. For example, refer to the first attached screenshot. Even if I manage to resolve the specific error by replacing ReactRouterRoute={Route as React.JSXElementConstructor<any>}
, which is not an optimal solution but just a quick fix, and try to compile again, another TypeScript error occurs, and this keeps happening.
So, I suspect that upgrading GoodData packages has caused a version incompatibility. How should we approach and resolve this? You already have the reproducer with all our package versions. Can you please check and let us know?
cc @Byron Antoniadis @Konstantinos KoroneosByron Antoniadis
02/05/2024, 2:02 PMRadek Novacek
02/05/2024, 2:12 PM@types/react
- related Stack Overflow discussion.
I'm very sorry for the delays in troubleshooting this, however, with the GD.UI version mismatch solved, once you get over this React version related issue, we should finally be over all the issues here.Radek Novacek
02/05/2024, 2:47 PMDanai Chronopoulou
02/05/2024, 2:48 PMDanai Chronopoulou
02/06/2024, 11:54 AMDanai Chronopoulou
02/06/2024, 12:05 PMRadek Novacek
02/06/2024, 12:24 PMRadek Novacek
02/06/2024, 1:02 PMDanai Chronopoulou
02/06/2024, 1:05 PMRadek Novacek
02/06/2024, 1:10 PMDanai Chronopoulou
02/06/2024, 1:17 PMconst backend = useBackendStrict();
const ws = useWorkspaceStrict();
2. Upgraded all packages:
"@gooddata/api-client-tiger": "8.12.3",
"@gooddata/sdk-backend-tiger": "8.12.3",
"@gooddata/sdk-model": "8.12.3",
"@gooddata/sdk-ui": "8.12.3",
"@gooddata/sdk-ui-all": "8.12.3",
"@gooddata/sdk-ui-charts": "8.12.3",
"@gooddata/sdk-ui-dashboard": "8.12.3",
"@gooddata/sdk-ui-ext": "8.12.3",
"@gooddata/sdk-ui-geo": "8.12.3",
"@gooddata/sdk-ui-kit": "^8.12.3",
"@gooddata/sdk-ui-pivot": "^8.12.3",
So, all CSS styles and elements are in place as you can see in the reproducerRadek Novacek
02/06/2024, 1:23 PMDanai Chronopoulou
02/06/2024, 1:35 PMRadek Novacek
02/06/2024, 1:42 PMhighcharts-root
class for the first widget and check that it and all its parents have a meaningful size? It will be inside DIV class visualization
.Danai Chronopoulou
02/06/2024, 1:50 PM<div class="visualization-container-measure-wrap">
which should have the child: svg highcharts-root
is emptyRadek Novacek
02/06/2024, 2:09 PMComplete React subtree is missing which can have multiple reasonsCould I ask you to try and just render a plain Dashboard without providing any external filters? Just to ensure that the issue is in the Dashboard component itself and not in your integration with your React components.
Danai Chronopoulou
02/06/2024, 2:13 PM<Dashboard dashboard={idRef(selectedDashboard.id)} backend={backend} workspace={ws} />
By external filters you mean the params that I'm passing?Radek Novacek
02/06/2024, 2:17 PMDanai Chronopoulou
02/06/2024, 2:21 PM<Dashboard dashboard="605c1c35..." backend={backend} workspace={ws} />
Danai Chronopoulou
02/07/2024, 11:01 AMRadek Novacek
02/07/2024, 11:13 AMDanai Chronopoulou
02/09/2024, 7:16 AMRadek Novacek
02/09/2024, 9:56 AMRadek Novacek
02/09/2024, 10:16 AMDanai Chronopoulou
02/13/2024, 11:34 AMRadek Novacek
02/13/2024, 12:55 PMKonstantinos Koroneos
02/16/2024, 4:33 PMByron Antoniadis
02/18/2024, 8:10 AMGreta
02/19/2024, 12:37 PMRadek Novacek
02/19/2024, 12:46 PMRadek Novacek
02/19/2024, 5:15 PMKonstantinos Koroneos
02/22/2024, 6:30 PMByron Antoniadis
03/06/2024, 1:37 PMGreta
03/11/2024, 11:52 AMRadek Novacek
03/12/2024, 9:48 AM