Skip to content

Difficulty seeing errors in esbuild-plugin-livereload #137

Description

@ryanb

The livereload plugin has a great looking error overlay but I had difficulty getting it to work. After a bit of debugging I noticed that forceReload was true causing the reload to happen before the error could be shown. This was true because write: true needed to be set on my esbuild config. A few ideas to make this more intuitive.

  1. Isn't write enabled by default in esbuild? Perhaps if write is undefined it shouldn't force reload.
  2. The plugin states "write" option is disabled, so CSS updates will trigger a full reload which I ignored since I wasn't working with CSS. It appears this affects JS only changes too?
  3. Currently msg.errors?.length check is done at the end of thechange event. What do you think about doing it at the beginning? And then return early if there are errors so we can see them even if forceReload is true. I always want to see errors.

Thanks for the awesome plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions