Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tsc/internal/checker/jsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,11 @@ func (c *Checker) getJsxNamespaceContainerForImplicitImport(location *ast.Node)
if links.jsxImplicitImportContainer != nil {
return core.IfElse(links.jsxImplicitImportContainer == c.unknownSymbol, nil, links.jsxImplicitImportContainer)
}
// If the file is not an external module (no imports/exports), it cannot import the JSX runtime.
// Return nil to avoid the confusing "module path ... could not be found" error (Issue #64438).
if file.ExternalModuleIndicator == nil {
Comment on lines +1455 to +1457
return nil
}
canonicalErrorTag := links.firstJSXTagInFile
if canonicalErrorTag == nil {
var visit ast.Visitor
Expand Down