Commit 08333ad
Fix workspace dependency resolution - force workspace link
Problem Confirmed:
Yarn Classic was installing [email protected] from npm registry into
packages/react-on-rails-pro/node_modules/, even though Pro package specifies
"react-on-rails": "*" which should use workspace hoisting.
This caused webpack module resolution failures in CI:
ERROR: Package path ./pageLifecycle is not exported from package
/packages/react-on-rails-pro/node_modules/react-on-rails
Root Cause:
yarn.lock had cached resolution: react-on-rails@*: version "16.1.2"
This resolution persisted even after clean installs, causing Yarn to:
1. Install 16.1.2 from npm into Pro package's node_modules
2. The 16.1.2 version lacks the new exports field (./pageLifecycle, ./context, etc.)
3. Webpack fails when Pro package tries to import these subpaths
Solution:
Add explicit resolutions field to force workspace linking:
"resolutions": {
"react-on-rails": "link:./packages/react-on-rails"
}
This tells Yarn to ALWAYS use a symlink to the local workspace package,
bypassing the cached npm resolution in yarn.lock.
Verification:
✅ Local testing: packages/react-on-rails-pro/ has no node_modules subfolder
✅ yarn.lock now shows: react-on-rails@link:./packages/react-on-rails
✅ This matches the fix attempted earlier but reverted prematurely
Previous attempt (commit 34b7a1f) was reverted (commit 6dd869b) based on
assumption it caused test failures. However, those failures may have been
pre-existing or from other Phase 6 changes. Waiting for CI to confirm.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent e9e5f35 commit 08333ad
2 files changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6840 | 6840 | | |
6841 | 6841 | | |
6842 | 6842 | | |
6843 | | - | |
6844 | | - | |
6845 | | - | |
| 6843 | + | |
| 6844 | + | |
| 6845 | + | |
| 6846 | + | |
| 6847 | + | |
| 6848 | + | |
6846 | 6849 | | |
6847 | 6850 | | |
6848 | 6851 | | |
| |||
0 commit comments