-
Notifications
You must be signed in to change notification settings - Fork 34
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
FrozenError can't modify frozen Array (Rails 6.0 with zeitwerk autoloader) #52
Comments
Hi @sho918, thanks for reporting. I just quickly looked into this issue but it seems like the |
I couldn't replicate the issue with a fresh Rails app:
I'm not sure what's going on there, but you may need to purge bootsnap cache when switching. |
Thanks for response. But an error occurs when combination of Custom Exceptions App and Zeitwerk autoloader. $ rails new rambulance-test
$ cd rambulance-test
$ bundle add rambulance
$ rails g rambulance:install
$ rails s
$ open http://localhost:3000/rambulance/not_found # Works fine
# Install Custom Exceptions App
$ rails g rambulance:exceptions_app
# with Zeitwerk autoloader
$ rails r "puts Rails.autoloaders.zeitwerk_enabled?"
=> true
$ rails s
$ open http://localhost:3000/rambulance/not_found # FrozenError (can't modify frozen Array)
# without Zeitwerk autoloader (`config.autoloader = :classic`)
$ rails r "puts Rails.autoloaders.zeitwerk_enabled?"
=> false
$ rails s
$ open http://localhost:3000/rambulance/not_found # Works fine |
Confirmed this bug. I'll look into it. Thanks for reporting. |
I was able to replicate this bug in an actual rails app, but not in the test. I pushed the fix, but it would be great if you could confirm the fix on your side too. I will cut a new release once it's confirmed. |
Thank you for quick fix. |
released as part of |
Custom exceptions app not working with zeitwerk autoloader.
Works well with classic autoloader (
config.autoloader = :classic
).env
log
The text was updated successfully, but these errors were encountered: