3

I am trying to get started with Next.js, yet I receive the following error:

Module build failed: Error: Cannot find module 'react-hot-loader/babel' from '/home/ugurkaya/Desktop'

The following is my package.json:

  "name": "hello-next",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "^6.0.4-canary.6",
    "react": "^16.4.1",
    "react-dom": "^16.4.1",
    "react-hot-loader": "next"
  }

I added the react-hot-loader dependency manually when I get this error, yet it did not solve. Looking forward your helps!

2 Answers 2

3

I fixed this issue by just

npm install react-hot-loader --save-dev
0

This issue is generate because react not find react-hot-loader in dev dependancy

You can solve this problem you just need to install react-hot-loader as dev dependancy

npm install react-hot-loader --save-dev

Not the answer you're looking for? Browse other questions tagged or ask your own question.