Skip to content

Commit dc73e88

Browse files
smeng9arcanis
andauthored
Fix resolveExports thrown error (#6782)
## What's the problem this PR addresses? <!-- Describe the rationale of your PR. --> <!-- Link all issues that it closes. (Closes/Resolves #xxxx.) --> Closes #5958 ## How did you fix it? <!-- A detailed description of your implementation. --> Correctly handle the thrown error ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [ ] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [ ] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [ ] I will check that all automated PR checks pass before the PR gets reviewed. Co-authored-by: Maël Nison <[email protected]>
1 parent f23512b commit dc73e88

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/docusaurus/src/lib/npmTools.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,10 @@ export function useResolution({name, version}: {name: string, version: string},
227227
version,
228228
});
229229

230-
const exportsResolution = resolveExports(releaseInfo.npm, `.`, {
231-
conditions,
232-
})?.[0];
230+
let exportsResolution;
231+
try {
232+
exportsResolution = resolveExports(releaseInfo.npm, `.`, {conditions})?.[0];
233+
} catch {}
233234

234235
if (releaseInfo.npm.exports && !exportsResolution)
235236
return null;

0 commit comments

Comments
 (0)