amatsuda/jb

got ActionView::SyntaxErrorInTemplate error

xgrei opened this issue · 1 comments

xgrei commented
# Gemfile
gem 'jb', '~> 0.7.1'
ActionView::SyntaxErrorInTemplate (Encountered a syntax error while rendering template: check
16:58:04 backend.1  | @posts.map do |post|
16:58:04 backend.1  |   {
16:58:04 backend.1  |     title: post.title
16:58:04 backend.1  |   }
16:58:04 backend.1  | end

16:58:04 backend.1  | app/views/api/posts/latest.json.jb:5: syntax error, unexpected tIDENTIFIER, expecting '}'
16:58:04 backend.1  | app/views/api/posts/latest.json.jb:6: syntax error, unexpected ':', expecting end
16:58:04 backend.1  | app/views/api/posts/latest.json.jb:7: syntax error, unexpected ':', expecting end
16:58:04 backend.1  | app/views/api/posts/latest.json.jb:8: syntax error, unexpected ':', expecting end

rails: 6.0.2.2
ruby: 2.6.6

It seems a ruby syntax error, you can lint your file using rubocop or another tool to help