React-dnd: new-hotness ESModules + nextjs 8 + typescript

Created on 20 Jun 2019  ·  4Comments  ·  Source: react-dnd/react-dnd

Describe the bug
I have a project build up using nextjs v8 with typescript but I got a problem when importing apis from react-dnd 8.0.2

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2019-06-20 at 11 04 47 AM

Desktop (please complete the following information):

  • MacOS Mojave 10.14.5

Additional context

Screen Shot 2019-06-20 at 11 13 51 AM

.babelrc:
```{
"presets": [
"next/babel",
"@zeit/next-typescript/babel",
],
}

dependencies: 
```"dependencies": {
    "@weco/next-plugin-transpile-modules": "^2.2.1",
    "next": "^8.1.0",
    "next-transpile-modules": "^2.3.1",
    "react": "^16.8.6",
    "react-dnd": "^8.0.2",
    "react-dnd-html5-backend": "^8.0.2",
    "react-dom": "^16.8.6"
  },
  "devDependencies": {
    "@zeit/next-css": "^1.0.1",
    "@zeit/next-sass": "^1.0.1",
    "@zeit/next-typescript": "^1.1.1",
    "next-compose-plugins": "^2.2.0",
    "webpack-merge": "^4.2.1"
  }

component:
```import React from "react";
import { DndProvider } from "react-dnd";
import HTML5Backend from "react-dnd-html5-backend";

function Home() {
return (

Welcome to Next.js!


);
}

export default Home;
```

Most helpful comment

The v8 libraries are using ES Modules by default. It sounds like you need to use the react-dnd-cjs library instead

All 4 comments

+1, having the same issue.

+1 same here

^ @darthtrevino

The v8 libraries are using ES Modules by default. It sounds like you need to use the react-dnd-cjs library instead

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ffxsam picture ffxsam  ·  26Comments

jchristman picture jchristman  ·  27Comments

sslotsky picture sslotsky  ·  22Comments

gaearon picture gaearon  ·  30Comments

andrewQwer picture andrewQwer  ·  27Comments