kitze / custom-react-scripts

[DEPRECATED, use customize-cra] Allow custom config for create-react-app without ejecting
https://custom-react-scripts.netlify.com
MIT License
991 stars 96 forks source link

Build script does not terminate on its own #101

Closed MFry closed 7 years ago

MFry commented 7 years ago

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Environment

  1. node -v: v7.10.1
  2. npm -v: 5.3.0 and 4.6.1
  3. yarn --version (if you use Yarn): 0.27.5
  4. npm ls react-scripts (if you haven’t ejected):

Steps to Reproduce

yarn build

Expected Behavior

yarn run v0.27.5
$ react-scripts build
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  48.12 KB  build\static\js\main.9fdf0e48.js
  288 B     build\static\css\main.cacbacc7.css

The project was built assuming it is hosted at the server root.
To override this, specify the homepage in your package.json.
For example, add this to build it for GitHub Pages:

  "homepage" : "http://myname.github.io/myapp",

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

Done in 63.74s.

It terminates in some finite amount of time.

(Write what you thought would happen.)

Actual Behavior

The files are built but the built halts at the point:

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

| 

It awaits for some input as the carat is there.

This was reproduced on my mac, windows and on Travis CI. I have also had it running on my machine, to make sure it just didn't take a very long time, but it has been running for over two hour and still hasn't stopped.

Interestingly, if you attempt to terminate the batch script

^CTerminate batch job (Y/N)?

Entering either Y or N will result in the script terminating.

Reproducible Demo

create-react-app my-app --scripts-version custom-react-scripts 
yarn build
kimhanjoon commented 7 years ago

I have same issue with v0.2.0 but it is ok with v0.1.4. (node v6.11.0, npm v5.2.0)

alexsinfarosa commented 7 years ago

I am having the same issue with v0.2.0.

nhobi commented 7 years ago

Same issue here with v0.2.0. Would love to have this resolved so I can plug and play with heroku + create-react-app build pack. This currently stalls the build indefinitely.

Update: this works for me https://github.com/gr33k01/custom-react-scripts/commit/f6e1e4fd8dad2b3484e948288cba72fbb1ff8a5e

helton commented 7 years ago

I'm facing this problem too. As a workaround I followed the steps:

const successMessage = 'The build folder is ready to be deployed.' const result = shell.exec('timeout react-scripts build -t 1m')

if (result.stdout.includes(successMessage)) process.exit(0) else process.exit(result.code)



This is definitely **not a good solution**, but it doesn't hide any build issues and it makes sure the build script finally ends on its own.
I can finally deploy to Netlify now.

The solution specified by @gr33k01 seems promising, but I haven't tested it yet.
kitze commented 7 years ago

PR is merged now, sorry for the delay

hipertracker commented 7 years ago

It's merged but npm package is not updated :(

kitze commented 7 years ago

Hey @hipertracker, new version is published now. Let me know if it's fine!

helton commented 7 years ago

@kitze I've just tested. The new release worked fine 👍 Thanks, guys!

hipertracker commented 7 years ago

Works fine now. Thanks!