bud icon indicating copy to clipboard operation
bud copied to clipboard

Unable to live reload after SSR error

Open matthewmueller opened this issue 3 years ago • 0 comments

Currently when there's a server-side rendering error, that you subsequently fix, you'll need to refresh the page again. This is likely because the event source isn't hooked up to that error yet.

Steps to reproduce:

  1. Create a view with an error
<script>
  export let _string = ""
  a.b = 'c'
</script>

<h1>{_string}</h1>

<style>
  h1 {
    background: blue;
    padding: 20px;
    color: white;
  }
</style>
  1. Make a change to the controller:
package controller

type Controller struct {
}

func (c *Controller) Index() string {
	return "hello world."
}

func (c *Controller) Show(id string) string {
	return "shows/" + id
}

And you'll see something like ReferenceError: a is not defined in the browser. Even if you fix the problem in Svelte, it won't refresh.

matthewmueller avatar Jun 04 '22 18:06 matthewmueller