home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.04k stars 2.77k forks source link

Slow building #16868

Closed meduar closed 1 year ago

meduar commented 1 year ago

Checklist

Describe the issue you are experiencing

On Watcher "Changes detected. Starting compilation" it takes approximately 13 minutes building every time that I change a file, to develop in this way, I would take weeks doing something that normally takes minutes

Is there any way to disable some tasks in Gulp or in Webapack to make faster development

Any idea?

Describe the behavior you expected

Being able to compile closer to a minute when I do a change and save in the codeit code

Steps to reproduce the issue

  1. Save a file
  2. the watcher would take up to 13 minutes
  3. ...

What version of Home Assistant Core has the issue?

Latest

What was the last working version of Home Assistant Core?

Latest

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

No response

State of relevant entities

Does not apply

Problem-relevant frontend configuration

I probably need to change a config file, but I don't know which file.

Javascript errors shown in your browser console/inspector

Does not apply

Additional information

Does not apply

karwosts commented 1 year ago

Huh that's weird that it takes so long, for me it's not usually longer than 2-3 seconds, and that's on a 10 year old laptop. I've never changed any settings, just use whatever process is described on the frontend development page.

steverep commented 1 year ago

Agree - there's no way it should take that long even with a complete rebuild and no cache. Something is funky with your setup. And if I had to guess, it's running out of memory and doing a lot of swapping.

If you cannot narrow down the issue more, then please describe your setup in detail and exactly the steps you take in order for someone to help or reproduce.

meduar commented 1 year ago

When I modify /src/html/index.html.template, it doesn't update and I notice the watcher doesn't detect any change, how could I update this file? (do I need to rebuild) -> When I change a component it detects changes but it takes like 17 minutes to compile,

Those are the logs:

It is the devcontainer that comes on the repository on Windows:

LOGS:

[11:10:23] Starting 'build-translation-fingerprints'... [11:10:23] Finished 'build-translation-fingerprints' after 24 ms [11:10:23] Starting 'build-translation-write-metadata'... [11:10:23] Finished 'build-translation-write-metadata' after 52 ms [11:10:23] Finished 'build-translations' after 1.57 min [11:10:23] Starting 'copy-static-app'... [11:10:49] Finished 'copy-static-app' after 26 s [11:10:49] Starting 'webpack-watch-app'...

✔ Webpack Compiled successfully in 17.11m

I don't know what to do.

steverep commented 1 year ago

The HTML templates are not watched. If you already have a dev build in hass_frontend, just run gulp gen-pages-app-dev to re-create the HTML from your modified template. But can I ask why you need to modify that?

As for taking 17 min to rebuild, I don't know. I think you are either running out of resources or it's having a really hard time with I/O from your docker volume. Those questions would best be answered on Discord as it doesn't seem like a frontend issue.

meduar commented 1 year ago

I was just testing I was trying t to put "Hello world " on the index page, I am going to do it again from scratch

steverep commented 1 year ago

Okay. Closing unless this can be narrowed down to a real issue with our dev container config or something. Please do follow up on Discord if you need help though.