Shopify / packwerk

Good things come in small packages.
MIT License
1.54k stars 111 forks source link

[Bug Report] Syntax error: Invalid yield in a brand new Rails application #400

Closed fxn closed 2 months ago

fxn commented 3 months ago

Description

bin/packwerk check does not pass in a just generated Rails application, the command complains about the ERB templates.

To Reproduce

  1. Create a new Rails application.
  2. Add packwerk to its Gemfile
  3. Run bundle install
  4. Run bundle binstub packwerk
  5. Run bin/packwerk init
  6. Run bin/packwerk check

Expected Behaviour

bin/packwerk check passes.

Actual Behaviour

% bin/packwerk check
📦 Packwerk is inspecting 28 files
E.EE........................
📦 Finished in 1.4 seconds

app/views/layouts/application.html.erb
Syntax error: Invalid yield

app/views/layouts/mailer.html.erb
Syntax error: Invalid yield

app/views/layouts/mailer.text.erb
Syntax error: Invalid yield

3 offenses detected

No stale violations detected

Version Information

tqhung04 commented 3 months ago

I got the same issue here. Could anyone fix that? ><

irphilli commented 3 months ago

This a due to a bug in prism: https://github.com/ruby/prism/issues/2688

If you downgrade prism to 0.24.0, the error goes away.

a-abdellatif98 commented 2 months ago

This a due to a bug in prism: ruby/prism#2688

If you downgrade prism to 0.24.0, the error goes away.

@irphilli fixed the issue to me, Thanks,

exterm commented 2 months ago

Should be resolved in prism 0.27.0.

rafaelfranca commented 2 months ago

Closing since it is fixed on prism.