Skip to content

Ruby 3.4 and weird stacktraces #976

@23tux

Description

@23tux

I updated to Ruby 3.4.7 and noticed some weird behaviour in my Rails 7.1 app regarding error stack traces.

This template produces an error page in development as you would expect:

- if true
  - "foo"
- current_user.foo

The stacktrace in the browser output looks strange:

            @virtual_path = "spree/layouts/application";;@output_buffer = output_buffer || ActionView::OutputBuffer.new; if true; 
; "foo"; 
; end; current_user.foo; 
; @output_buffer
          end

However, when I change the template do this:

- if true
  - "foo"
  - 123
- current_user.foo

I just get the rendered 500.html page in my browser (which is pretty annoying during development), but the stacktrace in my stdout on my dev server looks better than the one I got in my browser:

ActionView::Template::Error (undefined method 'foo' for an instance of Spree::User):
    1: - if true
    2:   - "foo"
    3:   - 123
    4: - current_user.foo

app/views/layouts/application.html.slim:4:in '_app_views_spree_layouts_application_html_slim__1872156654256792566_3029336'

So this is very annoying while developing. Any idea how I could debug this more, or how this could be solved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions