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.

Problematic use of babel-plugin-flow-react-proptypes in ESM build

See original GitHub issue

The use of babel-plugin-flow-react-proptypes in the es Babel env causes many CJS require calls to end up in what should be an ESM build. You can observe this in the published build; for example, List contains require('../Grid').

This largely defeats the purpose of an ESM build, since it means that most modules in the build cannot be tree-shaken under any circumstances.

The problem was introduced in #731 and there’s some discussion about the need for the plugin in #730.


P.S. thanks for your amazing work on this library ❤️

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bvaughncommented, Jan 23, 2018

FYI it looks like the babel-plugin-flow-react-proptypes functionality was implemented via brigand/babel-plugin-flow-react-proptypes/pull/162 and published as 14.0.0.

0reactions
TrySoundcommented, Jan 31, 2018

Fixed in 9.18.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES Modules are terrible, actually - gists · GitHub
Once the ecosystem supports ESM well, I think that yes, ESM will make building JavaScript applications easier since it's supported natively in browsers...
Read more >
2 ESM interoperability issue with Node + Typescript + Webpack
At the end I've been able to figure out what was creating issues on the interoperability of the 2 ESM esm1 and esm2....
Read more >
Node Modules at War: Why CommonJS and ES ... - Code Red
CJS scripts use require() and module.exports; ESM scripts use import… ... time as ESM named exports. But that would create a new problem....
Read more >
Using ECMAScript modules (ESM) with Node.js
Learn about using ES modules in Node.js today and get a closer look at how you can migrate your codebase to make use...
Read more >
How to Create a Hybrid NPM Module for ESM and CommonJS.
The problem with .mjs. Before outlining the solution, let me put a sword in a few much touted techniques. Why not just use...
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