question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React refresh not compatible with @babel/preset-flow

See original GitHub issue

If I include @babel/preset-flow in the webpack-dev-server example, webpack fails to build it. If I remove hot reloading, webpack succeeds. I’ve created a small reproducible test case here:

https://github.com/michaelgmiller1/react-refresh-webpack-plugin/commits/flow-break

I think this is the last remaining issue for us to adopt React Refresh in our app!! Thanks again for all your work fixing my bug reports!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pmmmwhcommented, Jul 12, 2020

Fixed in 0.4.0-beta.8.

2reactions
pmmmwhcommented, Jul 8, 2020

Would it be possible to inject that runtime code after top-of-file comment lines/blocks?

The issue is that we don’t parse the file, so we have no idea if there exist a top-of-file comment.

I’ll see if we can work around that without doing string manipulation but it seems difficult at first glance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/preset-react
Though the JSX spec allows this, it is disabled by default since React's JSX does not currently have support for it. pure. boolean...
Read more >
Parsing error: Cannot find module '@babel/preset-react'
I have a React project. In the first line in every .js file where I import React, I am getting this error: Parsing...
Read more >
How to incrementally add Flow to an existing React app
Let's walk through each step, and then take a look at converting the example components. Install the main dependencies. Alongside Flow itself ...
Read more >
@babel/preset-flow | Yarn - Package Manager
Intro. Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain...
Read more >
What is @babel/preset-env and why do I need it? - Jakob Lind
This is supported in most browsers but not all, that's why it's a good idea to transpile it ... @babel/preset-env; @babel/preset-flow; @babel/preset-react ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found