pushtell/react-bootstrap-date-picker

Module not found: Can't resolve 'react-bootstrap/lib/Button' in '/var/www/html/quiz-management/frontend/node_modules/react-bootstrap-date-picker/lib'

Closed this issue ยท 23 comments

JUst Install and Use

ngrt commented

You can solve this by installing the 'create-react-class' lib.
npm i --save create-react-class

This didn't work for me. Still having the same issue

Having the same issue. Installing react-bootstrap did not help(it was installed in my project long ago)

@lauracabre - did you manage to fix this somehow?

Not compatible with react-bootstrap ^1.0.0?

2019
march

I'm still have this issue, and have no idea how to fix it properly

hey, is this issue solved?
Because I have facing the same issue even in verson 1.0.0-beta.8

Did anyone find the solution to this?

I am facing the same challenge with this, Anyone with any solution on this?

This is what I did
import Form from 'react-bootstrap/Form' instead of import FormGroup from 'react-bootstrap/lib/FormGroup',
import ControlLabel from 'react-bootstrap/lib/ControlLabel';,
import FormControl from 'react-bootstrap/lib/FormControl';
Then I used Form.Group, Form.Label Form.Control components in place of FormGroup, ControlLabel, FormControl and my form works fine.

Did anyone find the solution to this?

This is what I did
import Form from 'react-bootstrap/Form' instead of import FormGroup from 'react-bootstrap/lib/FormGroup',
import ControlLabel from 'react-bootstrap/lib/ControlLabel';,
import FormControl from 'react-bootstrap/lib/FormControl';
Then I used Form.Group, Form.Label Form.Control components in place of FormGroup, ControlLabel, FormControl and my form works fine.

2019
march

I'm still have this issue, and have no idea how to fix it properly

This is what I did
import Form from 'react-bootstrap/Form' instead of import FormGroup from 'react-bootstrap/lib/FormGroup',
import ControlLabel from 'react-bootstrap/lib/ControlLabel';,
import FormControl from 'react-bootstrap/lib/FormControl';
Then I used Form.Group, Form.Label Form.Control components in place of FormGroup, ControlLabel, FormControl and my form works fine.

Did anyone find the solution to this?

This is what I did
import Form from 'react-bootstrap/Form' instead of import FormGroup from 'react-bootstrap/lib/FormGroup',
import ControlLabel from 'react-bootstrap/lib/ControlLabel';,
import FormControl from 'react-bootstrap/lib/FormControl';
Then I used Form.Group, Form.Label Form.Control components in place of FormGroup, ControlLabel, FormControl and my form works fine.

Yes, mate it worked for me

This is what I did
import Form from 'react-bootstrap/Form' instead of import FormGroup from 'react-bootstrap/lib/FormGroup',
import ControlLabel from 'react-bootstrap/lib/ControlLabel';,
import FormControl from 'react-bootstrap/lib/FormControl';
Then I used Form.Group, Form.Label Form.Control components in place of FormGroup, ControlLabel, FormControl and my form works fine.

Can you share the code? I have added but did not work for me...

This is what I did
import Form from 'react-bootstrap/Form' instead of import FormGroup from 'react-bootstrap/lib/FormGroup',
import ControlLabel from 'react-bootstrap/lib/ControlLabel';,
import FormControl from 'react-bootstrap/lib/FormControl';
Then I used Form.Group, Form.Label Form.Control components in place of FormGroup, ControlLabel, FormControl and my form works fine.

Can you share the code? I have added but did not work for me...
of course, mate @kirlisakal

import Form from 'react-bootstrap/Form'

<Form.Group controlId="exampleForm.ControlTextarea1">
<Form.Label>Markdoen Input!</Form.Label>
<Form.Control componentclass='textarea' placeholder='input Markdown' as="textarea" rows="10" value={markdown} onChange = {(event)=> this.updateMarkdown(event.target.value)}`

       ` >`
        `</Form.Control >`
    `  </Form.Group>`

sorry about format, this is my final solution, the previous one I posted there was a bus in it, so this is the right one and it works well now!
Happy coding :)

This is what I did
import Form from 'react-bootstrap/Form' instead of import FormGroup from 'react-bootstrap/lib/FormGroup',
import ControlLabel from 'react-bootstrap/lib/ControlLabel';,
import FormControl from 'react-bootstrap/lib/FormControl';
Then I used Form.Group, Form.Label Form.Control components in place of FormGroup, ControlLabel, FormControl and my form works fine.

Can you share the code? I have added but did not work for me...
of course, mate @kirlisakal

import Form from 'react-bootstrap/Form'

<Form.Group controlId="exampleForm.ControlTextarea1">
<Form.Label>Markdoen Input!</Form.Label>
<Form.Control componentclass='textarea' placeholder='input Markdown' as="textarea" rows="10" value={markdown} onChange = {(event)=> this.updateMarkdown(event.target.value)}`

       ` >`
        `</Form.Control >`
    `  </Form.Group>`

sorry about format, this is my final solution, the previous one I posted there was a bus in it, so this is the right one and it works well now!
Happy coding :)

Thanks a lot for quick reply. But, I could not catch it! where is date-picker?

@kirlisakal
this is what I had to done for my app, I don't have an idea about date-picker, I used react-bootstrap for building markdown-reviewer,can u tell me about date-picker, I could help you!

Try this:
import { Button } from 'react-bootstrap';

I'm stuck with the same problem with getting a simple DatePicker example working as well. I have installed:
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^7.2.1",
"ag-grid-community": "^24.1.0",
"ag-grid-react": "^24.1.1",
"axios": "^0.21.1",
"bootstrap": "^4.5.3",
"create-react-class": "^15.7.0",
"d3": "^6.3.1",
"http-proxy-middleware": "^1.0.4",
"pm2": "^4.5.0",
"react": "^16.12.0",
"react-bootstrap": "^1.4.3",
"react-bootstrap-date-picker": "^5.1.0",

"react-dom": "^16.14.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.4",
"react-tooltip": "^4.2.11",
"react-widgets": "^4.6.1"
},

If you will consider source code of the last version of react-bootstrap (currently it's 1.4.3), you'll reveal that there's no lib directory there. Because the last update of react-bootstrap-date-picker package is 3 years ago in the case with react-bootstrap that's 19 days ago.

To make it work, you have to find a release version of react-bootstrap that was relevant to the last release of date-picker time.
I'm sure, this will resolve the issue.

Best regards.

./node_modules/react-bootstrap-date-picker/lib/index.js
Module not found: Can't resolve 'react-bootstrap/lib/Button' in 'D:\WorkingDirectory\NodeJsProject\ReactApp\SheepInsurance\node_modules\react-bootstrap-date-picker\lib'

tried all

anyone was able to solved it?

I tried all the versions. The lib/Button error goes away but you get an

TypeError: Cannot read property 'object' of undefined
./node_modules/react-bootstrap-date-picker/lib/index.js
node_modules/react-bootstrap-date-picker/lib/index.js:117
  114 | displayName: 'DatePickerCalendar',
  115 | 
  116 | propTypes: {
> 117 |   selectedDate: _react2.default.PropTypes.object,
      | ^  118 |   displayDate: _react2.default.PropTypes.object.isRequired,
  119 |   minDate: _react2.default.PropTypes.string,
  120 |   maxDate: _react2.default.PropTypes.string,