Giter Site home page Giter Site logo

Comments (4)

devloco avatar devloco commented on May 17, 2024

Looks like this is only a problem when enabling TypeScript. Which makes sense, since TSC is pushed onto a different thread, and thus any errors are not immediately reported by Webpack. Or something like that.

I imagine the changes that Facebook made to error overlay are exactly because of this.

from create-react-wptheme.

devloco avatar devloco commented on May 17, 2024

It's not pretty, but if you use TypeScript, keep your browser's JS console open. Errors are reported there.

from create-react-wptheme.

devloco avatar devloco commented on May 17, 2024

I played with this for quite a while over the weekend, and actually the bug is much less serious than I first thought. I quite accidentally stumbled on an edge case. The error overlay works with TypeScript in most cases. The only time I noticed the overlay not work was with a React Stateless Component on which I remarked out the import * as React from "react"; line.

I'm sure there are other case, but the trick here is that the error happens on the client-side, not in Webpack/serevr-side at all. The server side does not report any problem in that scenario. But React does see the problem, and reports it to the JS console.

Create-react-app is somehow capturing these client-side errors and sending them to the Error Overlay. I'll figure out how and update my implementation of the Error Overlay to work in a similar fashion.

from create-react-wptheme.

devloco avatar devloco commented on May 17, 2024

Fixed by updating to Create-React-App v.2.1.8.

from create-react-wptheme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.