Skip to content

Commit

Permalink
fix(framework-react): do not hang when react-docgen-typescript throw
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Dec 30, 2024
1 parent 5fa0939 commit b9be2a9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/framework-react/src/plugins/react-docgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import findUp from 'find-up'
import MagicString from 'magic-string'
import type { Documentation } from 'react-docgen'
import {
ERROR_CODES,
// ERROR_CODES,
builtinHandlers as docgenHandlers,
builtinResolvers as docgenResolver,
makeFsImporter,
Expand Down Expand Up @@ -101,10 +101,11 @@ export async function reactDocgen({
}
} catch (e: any) {
// Ignore the error when react-docgen cannot find a react component
if (e.code === ERROR_CODES.MISSING_DEFINITION) {
return src
}
throw e
// if (e.code === ERROR_CODES.MISSING_DEFINITION) {

// Don't throw in any cases otherwise the watch will hang.
return src
// }
}
// }
},
Expand Down

0 comments on commit b9be2a9

Please sign in to comment.