Closed guillaumebriday-pa closed 9 months ago
Hi @guillaumebriday-pa! What's at line 7 in your environment.rb?
# frozen_string_literal: true
# Load the Rails application.
require_relative "application"
# Initialize the Rails application.
Rails.application.initialize! # <-- THIS
So it does not really help me to find the root cause :/
Hey @guillaumebriday-pa, I'm afraid I can't replicate this at all and don't really know how to investigate it any further I'm afraid :(
I realise it's been a long time since you opened this issue and I'm sorry I can be of more help. I'm going to close this issue but if you have any additional info to share that could give me some clues then feel free to reopen it at any time.
Hi @allmarkedup
I dived into the issue and found something that might help
The problem comes from this line: https://github.com/ViewComponent/lookbook/blob/main/lib/lookbook/engine.rb#L74
For some reasons it only works in development
Engine.load_previews
causes the issue
And here is the real problem I guess
@guillaumebriday-pa okay thanks for digging into this a bit more.
reloaders.execute
should never be called in production, only in development, as there should be no file watching happening in production.
I'm not sure why it would be causing an argument error if it was running but it's worth just making sure that is disabled correctly.
In your config/environments/production.rb
file can you try setting the reload_on_change
config option to false
?
config.lookbook.reload_on_change = false
That setting is not normally needed but it should ensure that the reloaders are not running, even if Lookbook's logic for determining when to watch files is not working in this case.
Could you give that a try and see if that makes any difference?
It fails even in test, I changed the config
config.lookbook.reload_on_change = false
globally in application.rb
and still fails everywhere :/
Any idea @allmarkedup? 😇
@guillaumebriday-pa I'm sorry but I really don't know what is going on here. I can't replicate it myself and I haven't had any other reports of similar issues.
There may be something unique about your particular setup but I'm not sure how I can really progress this I'm afraid :(
Ok I fully understand, let's close it for now, I'll reopen it if I find something! 🙏
Describe the bug
My lookbook only works in development env. I follow these instructions https://lookbook.build/guide/installation and it works perfectly but whenever I tried to run in it in test or any other env, I got the error below without any further details.
Any idea why?
Thanks in advance
Screenshots
Version numbers
Please complete the following information:
Additional context
Add any other context about the problem here.