Skip to content

create-react-app v3 doesn't show TypeScript errors in overlay #2090

Open
@karlhorky

Description

@karlhorky

🐛 bug report

Description of the problem

TypeScript errors in a create-react-app sandbox are not displayed in the browser in the error overlay:

Screen Shot 2019-06-24 at 18 43 49

As a counter-example, the CRA errors in the overlay displayed locally:

Screen Shot 2019-06-24 at 18 37 50

I didn't find the original PR introducing this in CRA, but I found this PR discussing the feature: facebook/create-react-app#7091

Edit: Maybe this is the original PR? facebook/create-react-app#5903

This code from the PR looks like it could plausibly be the async handling of TypeScript errors (with modifying the webpack compilation stats and sending the errors and warnings to the webpack socket):

const messages = await tsMessagesPromise;
clearTimeout(delayedMsg);
statsData.errors.push(...messages.errors);
statsData.warnings.push(...messages.warnings);

// Push errors and warnings into compilation result
// to show them after page refresh triggered by user.
stats.compilation.errors.push(...messages.errors);
stats.compilation.warnings.push(...messages.warnings);

if (messages.errors.length > 0) {
  devSocket.errors(messages.errors);
} else if (messages.warnings.length > 0) {
  devSocket.warnings(messages.warnings);
}

How has this issue affected you? What are you trying to accomplish?

If possible, I would like to see TypeScript error messages in the error overlay in the browser (like in normal CRA locally).

Link to sandbox: link

Your Environment

Software Name/Version
Сodesandbox PROD-1561199685-a102c8493
Browser Chrome 75.0.3770.100
Operating System macOS 10.14.5

Ref (maybe related?): #1303

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions