Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with longer asset compilation times #34

Open
neontuna opened this issue Mar 28, 2024 · 1 comment
Open

Problems with longer asset compilation times #34

neontuna opened this issue Mar 28, 2024 · 1 comment

Comments

@neontuna
Copy link

Using Rails 7, jsbundling-rails and webpack we're having some issues with rails_live_reload triggering the reload before asset compilation finishes.

This is covered in the readme

...but in case your asset compilation takes couple of seconds, this might not work propperly, in that case we would recommend you to add configuration to watch output folder.

Which I've done

config.watch %r{app/views/.+\.(erb|haml|slim)$}
config.watch %r{app/assets/builds/.+\.(css|js|html|png|jpg|ts|jsx)$}, reload: :always

The problem is - it still seems like reload is occurring before compilation is actually done. Every other reload we see errors like the following

image

Forcing a refresh fixes it.

I was thinking maybe allowing for a static delay in config (after detecting change but before reload) might be a good solution.

@x9sim9
Copy link

x9sim9 commented Sep 30, 2024

I'm having the same issue and watching for assets/builds instead does not solve the issue for me either.

The issue happens because the reload is called on first detected change not last change and so one file may have been recompiled but other files may not yet have been finished.

Adding a delay that adds a window of time to wait for other changes to happen would be the simplest option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants