Replies: 1 comment
-
Sorry, not related to webpack |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug report
What is the current behavior?
onInvalidCandidate
callback function to handle invalid candidates, and printing corresponding error messages to the console.What is the expected behavior?
export function compileCandidates(
rawCandidates: Iterable,
designSystem: DesignSystem,
{ onInvalidCandidate }: { onInvalidCandidate?: (candidate: string) => void } = {},
) {
// ...
for (let rawCandidate of rawCandidates) {
let candidate = designSystem.parseCandidate(rawCandidate)
if (candidate === null) {
if (onInvalidCandidate) {
onInvalidCandidate(rawCandidate);
} else {
throw new Error(
Invalid candidate: "${rawCandidate}"
);}
continue; // Bail, invalid candidate
}
candidates.set(candidate, rawCandidate);
}
// ...
}
export function compileAstNodes(rawCandidate: string, designSystem: DesignSystem) {
let candidate = designSystem.parseCandidate(rawCandidate);
if (candidate === null) {
throw new Error(
Invalid candidate: "${rawCandidate}"
);}
// ...
}
Other relevant information:
webpack version: 5.90.3
Node.js version: v20.9.0
Operating System: Windows 11 Professional
Additional tools:
Beta Was this translation helpful? Give feedback.
All reactions