#Cloning A project from Github
1 messages · Page 1 of 1 (latest)
<@&987246452180930620> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
This is a Java server so you'd find more luck with a JavaScript server
But for your question, try running npm install first
Also are there any errors in chrome dev tools or the console? @timber ivy
I don't think there's any issue in chrome dev, as I have run my project on it before
It has nothing to do with language, just error in running a project cloned from github
yes you have an issue with running a javascript project from github
and you have provided no details of the error, the project, or anything
"i get a blank screen in chrome when I run npm start" doesn't tell us anything
Sorry to sound rude, but how this can be an error related to javascript, Its just I'm new to Github, never cloned anyone's project before.
This is how terminal is showing no error after npm start
Go to this url
And in the console ?
Its showing something like this...
Ah so fix that, did you read the readme on the github repo?
yep, I did
Seems the error is causing whole site to break, should use catch() to prevent this
He has written nothing in README section
In which part
No
The error is saying that you gave an invalid key, so you need to fix that
Yeah that's what I'm getting to
But how to do that?
Like do I need to his repo again?
It's probably written on his repo what to do I guess
This one is repo
well yes but he should use try catch and proper error handling
whole site shouldnt break because of missing key
export const commerce = new Commerce(process.env.REACT_APP_CHEC_PUBLIC_KEY, true);
You need to pass key as env variable
Where do I need to correct that?
I though change commerce to a function which will try return commerce
export const commerce = () => { try { return new Commerce(process.env.REACT_APP_CHEC_PUBLIC_KEY, true); } catch (e) {console.log(e) return EmptyCommerce ??? } }}
just format it
Do I need to write this on app.js file?
no
do this first
Why are you cloning the repo? It looks like it's using library that you need to register for an API key and it looks like it may end up costing you: https://commercejs.com/pricing. Not clue if it's any good, never heard of it.
No that's not a solution
If a public key is needed then the website shouldn't be able to work without
Doesn't seem user friendly
I mean I'm not sure this github project was intended to be used by others. I think somebody was probably just playing around with a library.
showing the user a white screen because for some reason your api is invalid will just make the user quit, log the error in console for developer show some error page for user