-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated TypeScript definitions file has broken import("") #8908
Labels
Comments
Note that a workaround for this issue seems to be declaring an explicit return type: return createElement(
ErrorBoundaryContext.Provider,
{
value: {},
},
children
) as ReactElement; // dist/index.d.ts
export class ErrorBoundary extends Component<PropsWithChildren> {
render(): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
} |
Hmm looks like TSC generates the dynamic import but we only handle import declarations (statements) here:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally reported at bvaughn/react-error-boundary#133
Parcel version 2.8.3
Repro
The easiest way to repro this is to:
yarn install && yarn build
dist/index.d.ts
Source
Output
Problem
Note the return type of the render method of
ErrorBoundary
– it tries to importErrorBoundaryContext
as though it werea separate package/module, rather than a variable that's already in scope.
The text was updated successfully, but these errors were encountered: