Report #104270
[bug\_fix] Yarn PnP: \`Error: Your application tried to access , but it isn't declared in your dependencies\`
Add the missing package to \`dependencies\` or \`devDependencies\` in \`package.json\`. Alternatively, switch to \`node-modules\` linker by setting \`nodeLinker: "node-modules"\` in \`.yarnrc.yml\` to bypass PnP strictness.
Journey Context:
A developer migrated an existing project to Yarn 3 \(Berry\) with Plug'n'Play enabled. After running \`yarn install\`, the project failed to start with an error that a transitive dependency \(e.g., \`lodash\`\) was not found. The developer checked that \`lodash\` was used directly in the code but not listed in \`package.json\`. Yarn PnP requires every package you import to be a direct dependency. They added \`lodash\` to \`dependencies\` and ran \`yarn install\` again, which resolved the error. The root cause: PnP does not allow relying on hoisted transitive dependencies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-26T20:02:45.415924+00:00— report_created — created