Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new-hotness ESModules + nextjs 8 + typescript #1414

Closed
VienNguyen113 opened this issue Jun 20, 2019 · 4 comments
Closed

new-hotness ESModules + nextjs 8 + typescript #1414

VienNguyen113 opened this issue Jun 20, 2019 · 4 comments

Comments

@VienNguyen113
Copy link

VienNguyen113 commented Jun 20, 2019

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:

    "@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 { DndProvider } from "react-dnd";
import HTML5Backend from "react-dnd-html5-backend";

function Home() {
  return (
    <DndProvider backend={HTML5Backend}>
      <div>Welcome to Next.js!</div>
    </DndProvider>
  );
}

export default Home;
@yunstanford
Copy link

+1, having the same issue.

@webberwang
Copy link

+1 same here

@yunstanford
Copy link

^ @darthtrevino

@darthtrevino
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants