Cli: Automatically open browser to netlify dev port on `netlify dev`

Created on 8 Nov 2019  路  1Comment  路  Source: netlify/cli

Many users internal & external have reported issues with running netlify dev where the logs saying where the netlify dev server is running disappears.

This leaves the user in a state where they cannot proceed and open/dev their app.

This has been seen effecting create react app & gatsby projects.

- What is the current behavior?

There is a log message that gets erased by certain tools (CRA/Gatsby)

This leaves the users wondering where the netlify dev app is actually running

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?

Automatically open the default browser (and re-use tab if one already is open). This is the behavior of create react app and its a nice DX.

So:

  1. Print the message "Netlify dev is now running on port:whatever"
  2. Then automatically open the dev app in the default browser

Most helpful comment

This is the top result on Google when looking to disable this behavior so posting solution to disable here. I ended up holding my version for a while until I finally found that you could just add autoLaunch = false to [dev] in netlify.toml.

Like so:

[dev]
  autoLaunch = false

Reference: https://github.com/netlify/cli/blob/master/docs/netlify-dev.md#netlifytoml-dev-block

>All comments

This is the top result on Google when looking to disable this behavior so posting solution to disable here. I ended up holding my version for a while until I finally found that you could just add autoLaunch = false to [dev] in netlify.toml.

Like so:

[dev]
  autoLaunch = false

Reference: https://github.com/netlify/cli/blob/master/docs/netlify-dev.md#netlifytoml-dev-block

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukasluecke picture lukasluecke  路  3Comments

RaeesBhatti picture RaeesBhatti  路  4Comments

mrlubos picture mrlubos  路  5Comments

jasikpark picture jasikpark  路  5Comments

cco3 picture cco3  路  4Comments