0

I want to develop a React Js app with the framework Primereact. Now I have the problem that some Imports can't be found.

The Import import {Button} from 'primereact/Button' throws the exception: Cannot find file: 'Button.js' does not match the corresponding name on disk: '.\node_modules\primereact\button.js

The second problem I have is that DatatableSubMenu and DatatableCrudDocu cannot be found. What is the correct import?

My package.json is:

"name": "selldesk",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "bootstrap": "^4.3.1",
    "primeicons": "^2.0.0",
    "primereact": "^3.3.2",
    "react": "^16.12.0",
    "react-bootstrap": "^1.0.0-beta.16",
    "react-dom": "^16.12.0",
    "react-scripts": "3.2.0",
    "reactstrap": "^8.1.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

I hope somebody can help me.

Afia
  • 683
  • 5
  • 17
gigashark
  • 29
  • 9

1 Answers1

2

It's because you have imported button incorrectly.

Change this

import {Button} from 'primereact/Button'; //uppercase

to

import {Button} from 'primereact/button'; //lowercase

Make sure to keep them lowercase. Check the docs for correct import statements -

https://www.primefaces.org/primereact/#/button

Atin Singh
  • 3,624
  • 2
  • 18
  • 25