Razzle: First time start in development mode doesn't completes successfully

Created on 7 Jun 2017  Â·  9Comments  Â·  Source: jaredpalmer/razzle

So only one of the server starts successfully and the other one(s) are not, as you can see here:

yarn dev v0.24.6
$ razzle start
 WAIT  Compiling...

 DONE  Compiled successfully

Your application is running at http://127.0.0.1:80


So I need to terminate the batch job and start it again.

Steps to reproduce:

  • Delete the build folder
  • Start the server in development mode
bug windows only

Most helpful comment

On linux, on a fresh start (the build folder doesn't exist), this issue is present.

$ yarn start 2>&1 | tee error
# content of error file
yarn start v1.0.1
$ razzle start
 WAIT  Compiling...

 DONE  Compiled successfully

Your application is running at http://localhost:3000

Content of build folder:

$ ls build
assets.json

Apparently, the build folder is created after the server is compiled. If the build folder is created before running yarn start everything works as expected:

$ rm -rf build && mkdir build && yarn start 2>&1 | tee output
# content of output
yarn start v1.0.1
$ razzle start
 WAIT  Compiling...

 DONE  Compiled successfully

Your application is running at http://localhost:3000

 WAIT  Compiling...

 DONE  Compiled successfully

Your application is running at http://localhost:3000

✅  Server-side HMR Enabled!
> Started on port 3000

Content of build:

$ ls build
assets.json  server.js  server.js.map

Steps to reproduce

As @kireerik said:

rm -rf build
yarn start

Workaround

Add rimraf (as @jaredpalmer suggested) and mkdirp (in order to create the build folder):

yarn add --dev rimraf mkdirp

And edit package.json:

{
  // ...
   "scripts" {
      "start": "rimraf build && mkdirp build && razzle start"
   }
  // ...
}

Versions:

$ uname -a
Linux 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017 x86_64 GNU/Linux
$ node -v
v8.4.0
$ yarn -v
1.0.1
$ yarn list razzle                                                                                                                                                                                 yarn list v1.0.1
└─ [email protected]
Done in 0.95s.

All 9 comments

I am working on a fix for Windows. Again this doesn't happen on Mac.

Temporary workaround:

yarn add rimraf --dev

in your package.json start script

{
   "scripts" {
      "start": "rimraf build && razzle start"
   }
}

Are you running in VM ?

No, I am using Windows (10) on my laptop.

This issue is not a big deal for me at all, I just reported it.

Hi @jaredpalmer, you can keep this issue closed if you wish.

I am just leaving a note here that this is still an issue as of version 0.8.2.

On linux, on a fresh start (the build folder doesn't exist), this issue is present.

$ yarn start 2>&1 | tee error
# content of error file
yarn start v1.0.1
$ razzle start
 WAIT  Compiling...

 DONE  Compiled successfully

Your application is running at http://localhost:3000

Content of build folder:

$ ls build
assets.json

Apparently, the build folder is created after the server is compiled. If the build folder is created before running yarn start everything works as expected:

$ rm -rf build && mkdir build && yarn start 2>&1 | tee output
# content of output
yarn start v1.0.1
$ razzle start
 WAIT  Compiling...

 DONE  Compiled successfully

Your application is running at http://localhost:3000

 WAIT  Compiling...

 DONE  Compiled successfully

Your application is running at http://localhost:3000

✅  Server-side HMR Enabled!
> Started on port 3000

Content of build:

$ ls build
assets.json  server.js  server.js.map

Steps to reproduce

As @kireerik said:

rm -rf build
yarn start

Workaround

Add rimraf (as @jaredpalmer suggested) and mkdirp (in order to create the build folder):

yarn add --dev rimraf mkdirp

And edit package.json:

{
  // ...
   "scripts" {
      "start": "rimraf build && mkdirp build && razzle start"
   }
  // ...
}

Versions:

$ uname -a
Linux 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017 x86_64 GNU/Linux
$ node -v
v8.4.0
$ yarn -v
1.0.1
$ yarn list razzle                                                                                                                                                                                 yarn list v1.0.1
└─ [email protected]
Done in 0.95s.

Hi @jaredpalmer, you can keep this issue closed if you wish.

I am just leaving a note here that this is still an issue as of version 0.8.7.

I don’t have a windows machine and can’t replicate on Mac

I'm experiencing the same issue and I'm not using yarn (the same behavior appears on Windows and GNU/Linux)... sometimes the process just got stuck on "Your application is running at http://localhost:3000" (no other outputs) even though the server is never started.

This is no longer an issue as of version 2.x.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexjoyner picture alexjoyner  Â·  3Comments

dizzyn picture dizzyn  Â·  3Comments

gabimor picture gabimor  Â·  3Comments

pseudo-su picture pseudo-su  Â·  3Comments

knipferrc picture knipferrc  Â·  5Comments