Skip to content

Commit 08333ad

Browse files
justin808claude
andcommitted
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

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,8 @@
9898
"url": "https://github.com/shakacode/react_on_rails/issues"
9999
},
100100
"homepage": "https://github.com/shakacode/react_on_rails#readme",
101-
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
101+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
102+
"resolutions": {
103+
"react-on-rails": "link:./packages/react-on-rails"
104+
}
102105
}

yarn.lock

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6840,9 +6840,12 @@ [email protected]:
68406840
webpack-sources "^3.2.0"
68416841

68426842
react-on-rails@*:
6843-
version "16.1.2"
6844-
resolved "https://registry.npmjs.org/react-on-rails/-/react-on-rails-16.1.2.tgz#27308d7d5806e73354eea2355c5c4036ade443d4"
6845-
integrity sha512-SiE168FgUtp9Sld2MAZUs2+R/D7B+SlNGX4zl9T2rB1QluzgTY042a4/i6v+ivQpBIhNjJujlVFIHYp+uVqjoQ==
6843+
version "0.0.0"
6844+
uid ""
6845+
6846+
"react-on-rails@link:./packages/react-on-rails":
6847+
version "0.0.0"
6848+
uid ""
68466849

68476850
react@^19.0.0:
68486851
version "19.2.0"

0 commit comments

Comments
 (0)