# Netlify dev --live is not hot reloading when I change code

**URL:** <https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320>\
**Category:** Support\
**Tags:** netlify-dev-open-beta, gatsby\
**Created:** [April 9, 2019, 5:31pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320 "2019-04-09T17:31:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![guayom](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/guayom/32/270_2.png) [@guayom](https://answers.netlify.com/u/guayom)\
**Post date:** [April 9, 2019, 5:31pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/1 "2019-04-09T17:31:50Z")

</div>

Hi! I’m just trying netlify dev and I think it is great!  
I’m running a gatsby website. It is a pretty much default install, except that I’m using styled-components and styled-system. I’m also using Sanity studio to edit content.  
When I change content, it hot reloads perfectly. I can edit anything in Sanity studio and the changes show up instantly. But when I change code, or styles, it doesn’t hot-reload. I have to reload the whole to see the changes.

Of course I know that this is a Beta feature, so I just wanted to let you know in case this helps you in any way. It is not an issue for me, I’m just playing around, so I don’t really need support. But if you want, I’d be happy to share the repo with you guys so you can reproduce the issue.

---

<div class="post-metadata">

**Author:** ![simon](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/simon/32/247_2.png) [@simon](https://answers.netlify.com/u/simon)\
**Post date:** [April 10, 2019, 8:18am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/2 "2019-04-10T08:18:48Z")

</div>

I’m seeing the same results. I’m also using Gatsby (no [sanity.io](http://sanity.io) though). When I change a Markdown file (via text editor, so no CMS although I do have Netlify CMS enabled on this site) the changes are hot reloaded, but any changes to other files aren’t.

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/daviddarnes/32/167_2.png) [@DavidDarnes](https://answers.netlify.com/u/DavidDarnes)\
**Post date:** [April 10, 2019, 9:53am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/3 "2019-04-10T09:53:20Z")

</div>

I have a similar issue with Jekyll, live reloading isn’t working but it appears the livereload js is not being served over https. Does anyone else here have the same error in their console?

---

<div class="post-metadata">

**Author:** ![simon](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/simon/32/247_2.png) [@simon](https://answers.netlify.com/u/simon)\
**Post date:** [April 10, 2019, 11:59am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/4 "2019-04-10T11:59:58Z")

</div>

I’m not seeing those errors with Gatsby. I get two warnings (for mitt.es.js.map and netlify-identity.js.map) but I don’t think they’re related to this issue:

---

<div class="post-metadata">

**Author:** ![DavidDarnes](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/daviddarnes/32/167_2.png) [@DavidDarnes](https://answers.netlify.com/u/DavidDarnes)\
**Post date:** [April 10, 2019, 2:55pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/5 "2019-04-10T14:55:30Z")

</div>

Ah ok, interesting. That error leads me to think that you’re using the Identity feature, is that right?

---

<div class="post-metadata">

**Author:** ![swyx](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/swyx/32/269_2.png) [@swyx](https://answers.netlify.com/u/swyx)\
**Post date:** [April 10, 2019, 3:31pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/6 "2019-04-10T15:31:59Z")

</div>

hi folks!

yea hot reloading is… hard. all i can say is our CTO handles it and will figure it out over time - thanks for your patience

---

<div class="post-metadata">

**Author:** ![biilmann](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/biilmann/32/17_2.png) [@biilmann](https://answers.netlify.com/u/biilmann)\
**Post date:** [April 10, 2019, 3:38pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/7 "2019-04-10T15:38:12Z")

</div>

Yeah, we currently have a few known bugs in the live tunnel around eventsource streams and websockets that we’re working on fixes for. Will update you all here once they go live.

---

<div class="post-metadata">

**Author:** ![simon](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/simon/32/247_2.png) [@simon](https://answers.netlify.com/u/simon)\
**Post date:** [April 10, 2019, 3:42pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/8 "2019-04-10T15:42:58Z")

</div>

Yeah I am, for Netlify CMS. I don’t actually use Netlify CMS in my dev environment so I’m not too bothered with this warning. It’s working fine when deployed and as far as Netlify CMS goes that’s all that matters for me.

---

<div class="post-metadata">

**Author:** ![idev](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@idev](https://answers.netlify.com/u/idev)\
**Post date:** [April 12, 2019, 9:23pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/9 "2019-04-12T21:23:54Z")

</div>

is there an example of `dev --live` for functions? my function is being served as text instead of executing the code.

i created a `functions` folder with a `hello.js` function and added a `netlify.toml` file as follows:

```auto
[build]
  publish = "site"
  functions = "functions"

```

and accessing my function via my given `dev-live-host/.netlify/functions/hello` and get back the content of `hello.js` instead of the result of executing the function.

---

<div class="post-metadata">

**Author:** ![swyx](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/swyx/32/269_2.png) [@swyx](https://answers.netlify.com/u/swyx)\
**Post date:** [April 13, 2019, 10:12am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/10 "2019-04-13T10:12:29Z")

</div>

have you tried `netlify functions:create`? bunch of demos for you.

---

<div class="post-metadata">

**Author:** ![idev](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@idev](https://answers.netlify.com/u/idev)\
**Post date:** [April 15, 2019, 2:04pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/11 "2019-04-15T14:04:39Z")

</div>

the issue in my case was that i added the `netlify.toml` file after running `dev --live`; I killed and restarted the dev deployment and expected behavior was realized.

---

<div class="post-metadata">

**Author:** ![calavera](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/calavera/32/8275_2.png) [@calavera](https://answers.netlify.com/u/calavera)\
**Post date:** [April 16, 2019, 4:42pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/12 "2019-04-16T16:42:32Z")

</div>

@guayom @simon the problems updating code in Gatsby projects should be solved now. We just released a new tunnel version that addresses the issue. You’d need to restart `netlify dev --live`.

---

<div class="post-metadata">

**Author:** ![biilmann](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/biilmann/32/17_2.png) [@biilmann](https://answers.netlify.com/u/biilmann)\
**Post date:** [April 16, 2019, 4:51pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/13 "2019-04-16T16:51:28Z")

</div>

As mentioned by @calavera the fix for HMR is live now.

---

<div class="post-metadata">

**Author:** ![simon](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/simon/32/247_2.png) [@simon](https://answers.netlify.com/u/simon)\
**Post date:** [April 17, 2019, 8:03am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/14 "2019-04-17T08:03:50Z")

</div>

@calavera @biilmann Thanks, that was quick! It’s working _better_, but not completely I think. If I open the netlify.live link on the same machine in Chrome it’s updating when I make changes to components, css, whatever. But I just shared the link with a collegae and he’s still not seeing those changes, only after refreshing. There are no console errors. When I open the same link on my iPhone or another laptop I’m also not seeing hot reloading. Also, content updates to markdown files used to work pretty reliable but right now it doesn’t work most of the time (on my own machine, using the netlify.live link).

I’ve updated to the latest version of the netlify-cli.

---

<div class="post-metadata">

**Author:** ![guayom](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/guayom/32/270_2.png) [@guayom](https://answers.netlify.com/u/guayom)\
**Post date:** [April 17, 2019, 11:20pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/15 "2019-04-17T23:20:21Z")

</div>

Hi! I tried it. But something weird is going on now. When I use just `netlify dev` everything works just fine. But when I try `netlify dev --live` and visit the generated address, the tunnel doesn’t show the directory I’m working on, but a completely different one.  
I made sure I have all the right settings on my `netlify.toml` and `.netlify/state.json`  
Do you have any clues? Maybe it’s something in my config, but I don’t know where to start looking.

---

<div class="post-metadata">

**Author:** ![mischkl](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/mischkl/32/249_2.png) [@mischkl](https://answers.netlify.com/u/mischkl)\
**Post date:** [April 24, 2019, 9:05am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/16 "2019-04-24T09:05:46Z")

</div>

When I run “netlify dev --live” I get the message “No dev server detected, using simple static server” … and no live-reloading on editing content or templates. I’m using the Hugo + Netlify CMS starter project aka “victor-hugo” package [GitHub - netlify-templates/one-click-hugo-cms: Hugo template with Netlify CMS](https://github.com/netlify-templates/one-click-hugo-cms) … I’m not really invested in this particular project yet, though I would like to stick to Hugo and Netlify CMS if possible. Are there other starter projects or tutorials that might be better suited to getting things working with Netlify Dev? Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![swyx](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/swyx/32/269_2.png) [@swyx](https://answers.netlify.com/u/swyx)\
**Post date:** [April 24, 2019, 5:17pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/17 "2019-04-24T17:17:59Z")

</div>

@mischkl that is our Hugo detector not working, not related to the issue in this thread (i.e. you have the same problem without --live as well)

the source is here: [netlify-dev-plugin/hugo.js at master · netlify/netlify-dev-plugin · GitHub](https://github.com/netlify/netlify-dev-plugin/blob/master/src/detectors/hugo.js) and it is looking for config files that dont exist in that template. add a config.yaml or config.toml for it to work.

---

<div class="post-metadata">

**Author:** ![mischkl](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/mischkl/32/249_2.png) [@mischkl](https://answers.netlify.com/u/mischkl)\
**Post date:** [April 25, 2019, 9:56am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/18 "2019-04-25T09:56:12Z")

</div>

Aha, I see. There actually is a config.toml file already present, it’s just that the complete Hugo project is under the ./site folder - is there any way to configure netlify dev to treat a subfolder as the root?

As it happens it’s not such a problem for me at the moment; I can use the built-in “npm start” task, which includes Browser-Sync - good enough for me for the time being. I guess that netlify dev will be the better choice when I start using advanced features like functions, though.

EDIT: I got it working with help from the [netlify-dev-plugin README](https://github.com/netlify/netlify-dev-plugin/), I just needed to add the lines to my netlify.toml file:

```
[dev]
  command = "yarn start"
  port = 3000
  publish = "dist"

```

Now things are working when I run “netlify dev”, which is all I need atm tbh. Somewhat oddly, though, “netlify dev --live” results in the following error:

```
Error: invalid argument "undefined" for "-l, --local" flag: strconv.ParseInt: parsing "undefined": invalid syntax
Usage:
   connect [flags]

Flags:
  -e, --endpoint string (default "api.netlify.com")
  -h, --help help for connect
  -l, --local int (default 8080)
  -s, --session-id string   
  -t, --token string        
  -v, --verbose

FATA[0000] invalid argument "undefined" for "-l, --local" flag: strconv.ParseInt: parsing "undefined": invalid syntax

```

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [April 30, 2019, 7:57am UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/21 "2019-04-30T07:57:07Z")

</div>

@mischkl, this is a long shot (and you are using the correct syntax from the documentation) but I think that error is because the port number isn’t quoted. Yes, the README does show it unquoted.

Would you please try changing this line:

```auto
  port = 3000

```

to this instead?

```auto
  port = "3000"

```

It is my hope this will resolve the error with `netlify dev --live`.

---

<div class="post-metadata">

**Author:** ![swyx](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/swyx/32/269_2.png) [@swyx](https://answers.netlify.com/u/swyx)\
**Post date:** [May 9, 2019, 6:19pm UTC](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320/22 "2019-05-09T18:19:52Z")

</div>

as far as i can tell unquoted doesnt matter

[Next page](https://answers.netlify.com/t/netlify-dev-live-is-not-hot-reloading-when-i-change-code/320.md?page=2)
