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

Version requirement for listen gem is not specified, and wrong version error is suppressed #592

Open
wheeyls opened this issue Feb 13, 2024 · 1 comment

Comments

@wheeyls
Copy link
Contributor

wheeyls commented Feb 13, 2024

If an app has an old version of listen installed, AutoReload stops working with no explanation.

I'm not sure how to fix this right now, but wanted to bring this up as an issue, might open a PR later.

To reproduce, in a Gemfile in a new app:

gem 'listen', '3.4.1'

AutoReload will silently stop working. The reason is that we're catching this error:

can't activate listen (~> 3.5), already activated listen-3.4.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)

On this line:

https://github.com/ViewComponent/lookbook/blob/8b123bf0ad2dc54e76303381797dd765a8074c7f/lib/lookbook/file_watcher.rb#L19

Could be resolved by letting the error raise? I'm not sure how to resolve an optional dependency.

@allmarkedup
Copy link
Collaborator

Hey @wheeyls, thanks for reporting this, and I'm really sorry it has taken so long to reply.

It's a tricky one, I'll try to have a think about the best way to handle it. We can't just let that error raise in way things are currently structured (otherwise apps without the Listen gem installed wouldn't get any file reloading capabilities) but this was always a pretty hacky solution - I'm sure there is a better way to handle it.

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