Create-react-app: build looks like success but it doesn't handle files well.

Created on 4 May 2018  路  4Comments  路  Source: facebook/create-react-app

Is this a bug report?

Yes, Maybe It is a bug.

When I install create-react-app with npm install create-react-app and I run create-react-app my-app.
Next,
cd my-app
npm run build
then, It looks like success to build, but Actually, I try to open the builded index.html, It specified the others file with absolute path. Therefore the index.html cannot read the others file so, the window is white.

Environment

My main environment is

MacOS High Sierra
npm '4.6.1'
node '8.9.3'
create-react-app '1.5.2'

and I tried in Ubuntu16.04 too, but it doesn't solved.
the environment is

Ubuntu 16.04
npm '3.5.2'
node '4.2.6'
create-react-app '1.5.2'

I tried [email protected] too.
However, I couldn't be solved.

Most helpful comment

The instructions I linked to above will allow you to check the build locally. The static server is just a small npm package that runs a local server, similar to what happens when you run npm run start except it uses the files from the build.

All 4 comments

You need a web server to serve the build. You can find instructions on setting one up here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#static-server

If you just want to run the app locally you can use npm run start instead.

Thenk you for replying.
I understood well.

However, In my memory, I could check on my local PC the build is success or fail, to open the build file.
It is because, sometimes, npm run start looks like well but, build has some issue and it didn't work well, so I want check the build file.
How do I check my build file.

Are there the other way but deploy?

The instructions I linked to above will allow you to check the build locally. The static server is just a small npm package that runs a local server, similar to what happens when you run npm run start except it uses the files from the build.

oh, Sorry for my careless.
Thanks to your reply, I could check my source code.

Thank you very much!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dualcnhq picture dualcnhq  路  3Comments

AlexeyRyashencev picture AlexeyRyashencev  路  3Comments

wereHamster picture wereHamster  路  3Comments

fson picture fson  路  3Comments

alleroux picture alleroux  路  3Comments