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-dnd v9 uses spread operator, breaks older browsers

See original GitHub issue

Describe the bug

Typically, consumers of libraries like react-dnd don’t run their node_modules through Babel to transform newer syntax. There’s a bit of a debate over when and how we should all start doing that, but it’s not a great option right now. In v9, the es-modules exported version of react-dnd also started using some newer browser features (specifically, the spread operator) which if not transpiled out will fail to parse in browsers like MS Edge 17 which still don’t support that syntax.

Reproduction

Steps to reproduce the behavior:

  1. Bundle an app with v9 of react-dnd
  2. Open in Edge 17.
  3. SCRIPT1028: Expected identifier, string or number

Expected behavior

It’s expected that libraries (even if they are vended as ES modules) do not use newer syntax, or that they include specific instructions in the README that they must be run through babel in order to work.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
darthtrevinocommented, Jul 10, 2019

Actually, using babel directly for all transpilation is pretty great. And this wouldn’t necessitate a major version cut

2reactions
darthtrevinocommented, Jul 10, 2019

I’ll look into chaining babel after the tsc compilation. I think some light processing to hit a fixed browsers target “>.25%, not dead”, makes sense

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - React DnD - GitHub Pages
Troubleshooting. This page is dedicated to the problems you might bump into while using React DnD. Could not find the drag and drop...
Read more >
Zero to Full Stack Hero SALE! - PAPA React
Sonny Sangha presents Zero to Full Stack Hero It's NOT just another COURSE It's the world's BEST COMMUNITY No coding experience required Learn...
Read more >
Upgrade Guide – Frontend — Plone Documentation v6.0-dev
This upgrade guide lists all breaking changes in Volto and explains the steps ... Using the spread operator while you mutate the configuration...
Read more >
front-end/node_modules/@material-ui/core/CHANGELOG.md
Using the React error decoder as inspiration, the exceptions thrown by Material-UI in ... [core] Remove old JSS v9 animationName property (#16779) @merceyz ......
Read more >
Browse Javascript Technical Problem Clusters - Code Grepper
... Site cannot be accessed broken link or url that doesn't exist react ... Use multiple conditional operators in the checkSign function to...
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