Frank Imhof
07/03/2023, 5:14 PMpnpm create vite
The following is my App component.
The code for
• WorkspaceListProvider
• useAuth
I copied from the toolkit create-react-app example.
import { BackendProvider, WorkspaceProvider } from "@gooddata/sdk-ui";
import { useAuth } from "@/contexts/Auth";
import { WorkspaceListProvider } from "@/contexts/WorkspaceList";
import { InsightView } from "@gooddata/sdk-ui-ext";
import { Insights } from "../../goodDataCatalogOut";
function App() {
const { backend } = useAuth()
console.log("Backend", backend)
return (
<BackendProvider backend={backend}>
<WorkspaceListProvider>
<WorkspaceProvider workspace="d3d7aea47708404396d01d00fa971c8f">
<div>Hi there</div>
<InsightView insight={Insights.Cases}/>
</WorkspaceProvider>
</WorkspaceListProvider>
</BackendProvider>
);
}
export default App;
The result is:
The page loads and displays the insight for 1 second, but then the insight disappears.
There is no error, not in the browser console and not in the terminal where vite server is running.
What I have done:
I set up CORS for httplocalhost5173 (in my good data trial account cloud)
What I haven't done:
• I have not set up a proxy. Because the application created with the toolkit also works without setupProxy.js.
• I am not running on https, I am running on http. Do I need to run my dev server on https?
What am I doing wrong?
Please help.Moises Morales
07/03/2023, 5:24 PMFrank Imhof
07/03/2023, 6:16 PMserver{
https: {
key: fs.readFileSync(localhost.key),
crt: fs.readFileSync(localhost.crt)
}
}
• restarted the dev server on https://localhost:5173
Result:
Insight is displayed for ~300ms and then disappears. No errors in the browser/terminal.Moises Morales
07/03/2023, 6:22 PMFrank Imhof
07/03/2023, 6:50 PMMoises Morales
07/03/2023, 7:01 PMJan Rehanek
07/04/2023, 8:56 AMJan Rehanek
07/04/2023, 8:56 AMJan Rehanek
07/04/2023, 8:57 AMJan Rehanek
07/04/2023, 9:00 AMFrank Imhof
07/04/2023, 12:21 PMFrank Imhof
07/04/2023, 12:42 PM{
"name": "good-data-vite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"refresh-md": "./node_modules/.bin/gdc-catalog-export"
},
"dependencies": {
"@gooddata/sdk-backend-tiger": "^8.12.1",
"@gooddata/sdk-model": "^8.12.1",
"@gooddata/sdk-ui": "^8.12.1",
"@gooddata/sdk-ui-charts": "^8.12.1",
"@gooddata/sdk-ui-dashboard": "^8.12.1",
"@gooddata/sdk-ui-ext": "^8.12.1",
"@gooddata/sdk-ui-filters": "^8.12.1",
"@gooddata/sdk-ui-geo": "^8.12.1",
"@gooddata/sdk-ui-pivot": "^8.12.1",
"classnames": "^2.3.1",
"formik": "^2.2.9",
"lodash": "^4.17.15",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-router-dom": "^5.3.0",
"react-router-use-location-state": "^3.1.2",
"use-location-state": "^2.3.1"
},
"devDependencies": {
"@types/react": "17.0.2",
"@types/react-dom": "17.0.1",
"@gooddata/catalog-export": "^8.12.1",
"@vitejs/plugin-react": "^4.0.0",
"typescript": "^5.0.2",
"vite": "^4.3.9"
}
}
Frank Imhof
07/04/2023, 12:46 PMJan Rehanek
07/04/2023, 12:47 PMJan Rehanek
07/04/2023, 12:47 PMPreserve log
setting checked.Jan Rehanek
07/04/2023, 12:49 PMFrank Imhof
07/04/2023, 12:55 PM