Commit 777bee2
Skip version validation when package.json doesn't exist during setup (#1913)
This fixes an error that occurs when running `rake shakapacker:install`
on a fresh Rails application. The validation was introduced in commit
0d87ea7 and runs during Rails initialization via an `after_initialize`
hook.
The problem: `shakapacker:install` needs to load the Rails environment
before it can create package.json, but the version validation runs
during environment loading and fails because package.json doesn't exist yet.
The fix: Skip validation if package.json doesn't exist yet. This allows
installation tasks to complete successfully while still validating
versions on normal Rails application startup.
This issue was reported in CI logs where `rake shakapacker:install`
would fail with "package.json file not found" error.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>1 parent 024b0e2 commit 777bee2
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
0 commit comments