0

I copied carousel code in bootstap react page. it gave this error : ./node_modules/bootstrap/dist/js/bootstrap.esm.js Module not found: Can't resolve '@popperjs/core' in .....

.However, I did install popper.js by typing npm install popper.js Also I tried this: npm install popper.js --save. And I imported at beginning of the page like so :

import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Carousel } from 'bootstrap';
import Popper from 'popper.js';

What did I wrong please help me. Also Should import same thing in my index.js file. Thanks in advance.

Yasmin
  • 57
  • 1
  • 6
  • 1
    Does this answer your question? [How to fix this error : " Module not found :can't resolve popper.js "](https://stackoverflow.com/questions/57459917/how-to-fix-this-error-module-not-found-cant-resolve-popper-js) – Naveen Setty Oct 09 '21 at 22:26
  • @NaveenSetty yes. in return I got this error: TypeError: Class constructor Carousel cannot be invoked without 'new' – Yasmin Oct 09 '21 at 22:33
  • make sure that you are using the react version of bootstrap: https://react-bootstrap.github.io/ – Dov Rine Oct 10 '21 at 04:37

0 Answers0