Auto open browser when run dev #13448
-
|
Is there a way to open a browser when running |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 17 replies
-
|
Unfortunately that is not possible currently. See #12233
|
Beta Was this translation helpful? Give feedback.
-
|
For a simple work-around on a *nix system just do this in "scripts": {
"dev": "npm run open-browser && next dev",
"open-browser": "open http://localhost:3000",
}The page will load once the server starts, but it will show "can't be reached" for a moment. It's not perfect but it works fine. |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
I use this for windows
Please note that there is only one Instead of From windows command prompt execute |
Beta Was this translation helpful? Give feedback.
-
|
I suggest you leave the existing "open-browser": "open http://0.0.0.0:3000",
"dev-open-browser": "next dev -p 3000 & $npm_execpath open-browser"
note: for Windows you might need to replace |
Beta Was this translation helpful? Give feedback.
-
|
go to package.json and updated like this : |
Beta Was this translation helpful? Give feedback.
-
|
For linux |
Beta Was this translation helpful? Give feedback.
-
|
try |
Beta Was this translation helpful? Give feedback.
-
|
this will avoid the need for the refresh, just pipes the open over to a background process, also avoid the ghost process stuff that some solutions suggest result in |
Beta Was this translation helpful? Give feedback.
-
|
Taking inspo from @jaydioar and @phyzical, I used a prescript. |
Beta Was this translation helpful? Give feedback.
-
|
Hello, If this is something you still need, feel free to try it out or give feedback. |
Beta Was this translation helpful? Give feedback.

Unfortunately that is not possible currently. See #12233