Hi, I installed `@gooddata/create-gooddata-react-a...
# gooddata-ui
m
Hi, I installed
@gooddata/create-gooddata-react-app
and able to run on locahost showing simple tables and charts from cloud, so It's a great boilerplate starter. To continue with POC, I need to deploy build folder to subdomain like analytics.example.com, hosted on google cloud storage. I got this far, I can access the dub domain but the charts don't show. How to connect to backend from subdomain. Any suggestions?
This is error on login page
image.png
@Jan Soubusta
j
Are you trying to integrate with GoodData.CN or with our hosted platform?
m
Hi Jan, I'm on the hosted platform, react and gdui
This is the subdomain where I deployed https://rentaleye.central.sc/
j
In case of error 400 I would expect a human readable message explaining the cause of the error. Can you see anything like this in the browser console? Anyway, I am an expect neither on the hosted platform nor on gdui. @Dan Homola could you help here?
d
Hi, this is strange, can you please provide some more info about your deployment? Have you tried the
build-with-explicit-hostname
described in the readme? Maybe that is what you are missing 🙂
m
Thanks @Dan Homola Yes I saw that, tried already with same result.
Saw this is the docs: you can build and deploy the app manually (keep in mind that you will have to setup CORS on your GoodData domain so that it allows access from your application). How do I do that?
d
Right, CORS could be the issue. Please check out the relevant documentation page: https://sdk.gooddata.com/gooddata-ui/docs/platform_cors.html
m
There's a few things to unwrap, some feedback maybe... 1. On localhost, this code in the original code of https://github.com/gooddata/gooddata-create-gooddata-react-app does not work, gives CORS import { backend as hostname } from "../../constants"; const backendConfig = process.env.REACT_APP_SET_HOSTNAME ? { hostname } : {}; Changing it to this works: import { backend } from "../../constants"; const backendConfig = process.env.REACT_APP_SET_HOSTNAME ? { backend } : {}; This is with .env REACT_APP_SET_HOSTNAME=false
2. I've read the article about CORS. Do you mean I have to contact the sales team? deploying on my subdomain is what you call white labelling? I don't know how to enable CORS, I'm on the free plan doing a POC for a client and I need to continue testing on a sub domain, for auth, sso and performance testing from different locations.
d
Thank you for the feedback! I will investigate the config you mention in the first item and get back to you. As for the CORS, I think you need to contact support (can you please confirm @Boris that also freemium users can do this?).
b
hi @Michael Serres, @Dan Homola yes, freemium users can set up CORS by themselves via our public API. - https://help.gooddata.com/doc/free/en/expand-your-gooddata-platform/api-reference#tag/allowed-origins
🙌 1
d
So looking into your code changes, I am a bit confused, as your change should not do anything if
REACT_APP_SET_HOSTNAME
is false. If it is true, your change basically disables it, as
backend
is an invalid key in the config object and is never read 😕
m
Hi @Dan Homola, I figured how to build it properly, so now I get the CORS errors on the subdomain, which is a step forward! Let me check the docs from @Boris
d
Awesome, hope the rest will be easier 🙂
m
So my user is admin on the domain https://digitalcentral.on.gooddata.com/ - YES I'm logged in with that user - YES Going to https://digitalcentral.on.gooddata.com/gdc/domains/rentaleye.central.sc/securitySettings/allowedOrigins Give error:
Copy code
{
  "error": {
    "errorClass": "AuthorizationFailedException",
    "trace": "",
    "message": "Can be accessed only by domain admin",
    "component": "Webapp",
    "errorId": "59b92456-17cb-4efa-8fd0-34bced014835",
    "errorCode": "gdc.security.authorization",
    "parameters": []
  }
}
b
it's the user that registered the freemium, let me send it in DM
m
I was able to complete the deployment and add subdomain to CORS, thank you for the help!
🙌 1