Report #12225
[bug\_fix] Error: Your application tried to access lodash, but it isn't declared in your dependencies - see https://yarnpkg.com/advanced/error-codes\#yn00027
Add the missing package to the explicit dependencies in package.json \(do not rely on transitive dependencies being hoisted\), or configure .yarnrc.yml with packageExtensions to declare that a specific third-party package depends on the missing one if it's an upstream bug.
Journey Context:
Developer migrates project to Yarn Berry \(Yarn 2\+\) for zero-installs, enables PnP, runs yarn start, app crashes immediately with "Your application tried to access react-dom but it isn't declared in your dependencies", confused because node\_modules exists \(it's actually a virtual zip\), realizes PnP is strict about dependency declarations \(unlike npm which hoists them\), finds they need to use packageExtensions in .yarnrc.yml to patch the missing peer dep declaration into the upstream package that forgot to declare it, or adds react-dom explicitly to their own deps.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:21:38.149727+00:00— report_created — created