Skip to content

Commit

Permalink
Fix undefined package_json during Yarn install (#676)
Browse files Browse the repository at this point in the history
When running `rails stimulus_reflex:install` on a new Rails app using
Yarn & esbuild, the following error is raised:

```
  --- [yarn] ----
  rails aborted!
  NameError: undefined local variable or method `package_json'
  for #<Rails::Generators::AppGenerator...
```

Looks like it's a missing update from
#655

## Why should this be added
Setup raises errors at the Yarn step
  • Loading branch information
mattboldt committed Nov 29, 2023
1 parent 208409e commit 7d8baa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/install/yarn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
dev = dev_package_list.exist? ? dev_package_list.readlines.map(&:chomp) : []
drop = drop_package_list.exist? ? drop_package_list.readlines.map(&:chomp) : []

json = JSON.parse(package_json.read)
json = JSON.parse(package_json_path.read)

if add.present? || dev.present? || drop.present?

Expand Down

0 comments on commit 7d8baa7

Please sign in to comment.