Reactjs

I Created a react app using “Create-react-app” but it when i typed “npm start” it failed to display on the browser… Just a blank white screen… I checked the Terminal it was properly compiled…Please I need help to solve this issue!!!

Hi @emmanuel009 !

Are you sure the commands are spelt / lower or upper cased properly? Did you get an error after you typed ‘Create-react-app’? If so, you’re meant to do create-react-app, no caps.

You might want to give your React website some basic code, at least something saying Hello World. If you’re using a tutorial, perhaps you could re-play that part again?

This is what you want to do:

create-react-app react

What this does is create a project / folder somewhere in your File Explorer called react. If you have problem finding it, click the ‘up arrow’ top left of the File Explorer. Next click your avatar / username folder. Then somewhere, you’ll find your project, open up the folder in your code editor and you’re good to go!

Thank you for your reply… I’ve checked the code properly… and it shows that the code is properly compiled and my default browser was launched properly… I really don’t know why I’m seeing an ordinary blank white screen… If they had been any mistake from my code, it wouldn’t have compiled properly… When i check the console i saw this error… “Uncaught syntaxError: use of const in strict mode…”

Hey @emmanuel009 !

Would you mind sharing with us a snippet of your code / file in a gist?

Thanks!

I really don’t know how to do this… I joined github not too long…

@emmanuel009that’s okay!

Here’s 3 quick steps to do it:

Step 1. Enter your file name

Step 2. Copy your code from your code editor and paste in in the ‘big area’

Step 3. Click ‘Create public gist’, copy the link and share it here!

Or, you can post it in this topic. But just to keep it clean, I’d rather: create a gist or share the link to my repository that has the code!

Alright… Thank you for your time… But I really don’t know which among the code… Is it the "package.json, app.js,node_module… " i really wish i could forward the entire folder to you so you can run it and make every necessary correction…

I just pasted my codes on the public gist platform…I really wanna know why my react app is not displaying on my browser!

I haven’t seen your gist, as there’s no link to it. There’s one possibility; if it’s in a JS file or so, check your console, there might be some ‘Hello World’ text in it.

Javascript is an interpreted language and is not “compiled”. This means that flaws and mistakes don’t show up from your code until you run the program.

You’ll want to insure you have the latest version of any dependencies - googling this error suggests it often appears when some dependency is out of date.

Is there any additional information provided along with the “SyntaxError: Use of const in strict mode…” error? 

Since create-react-app is a Github project, you might get a better result by posting an issue in their repository, at

https://github.com/facebook/create-react-app/issues