Warning: session_start(): open(/tmp/sess_66ce9fab1afb45e9ea8e5334b3196e6e, O_RDWR) failed: Disk quota exceeded (122) in /home/wvyrfnwn/learnshareit.com/wp-content/plugins/learnpress/inc/class-lp-page-controller.php on line 1007

Warning: session_start(): Failed to read session data: files (path: /tmp) in /home/wvyrfnwn/learnshareit.com/wp-content/plugins/learnpress/inc/class-lp-page-controller.php on line 1007

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 719

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 719

Warning: ftp_mkdir() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 562

Warning: ftp_nlist() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230

Warning: ftp_pwd() expects parameter 1 to be resource, null given in /home/wvyrfnwn/learnshareit.com/wp-admin/includes/class-wp-filesystem-ftpext.php on line 230
How To Fix "Module not found: Can't resolve 'popper.js'" Error In React - LearnShareIT

How To Fix “Module not found: Can’t resolve ‘popper.js'” Error In React

Module not found: Can’t resolve ‘popper.js’

In this article, we will discuss the error message: “Module not found: Can’t resolve ‘popper.js'” in React. Check the information and figure out the solution.

Reproduce the error: “Module not found: Can’t resolve ‘popper.js'”

Popper.js is a compact Javascript library that helps you increase the speed of your website while retaining the functionality that requires a tooltip. It is often used in popular libraries today, such as Bootstrap, Foundation, and Material UI … It helps us solve a common problem in tooltips like positioning the element and displaying it as best as possible on different device screens.

When you don’t have popper.js library, then you will get the message “Module not found: Can’t resolve ‘popper.js'” because the ‘@popperjs/core‘ package is not installed on your machine yet.

For example, in your App.js:

import '@popperjs/core';
// ...

Output:

Solutions to fix this problem

To fix this problem, it’s very simple. You just need to install according to the installation instructions of the ‘@popperjs/core‘ package.

Use Package Manager

Open the terminal on your root directory and run this command:

:: Using npm
npm install @popperjs/core
:: Using yarn
yarn add @popperjs/core

If you can’t use these commands above, try re-running it with the --force flag.

:: Using yarn
yarn add @popperjs/core --force

Manually, you can open the package.json file and then enter the following line: "@popperjs/core": "<version_of_popperjs>" in the ‘dependencies’ object. Finally, run the command npm install.

After successfully installing the ‘@popperjs/core package , ‘@popperjs/core must be in the ‘dependencies’ object in package.json file. Otherwise, you have performed the incorrect installation. Your package.json file should look like this:

{
    ...
    "dependencies": {
     	...
      	"@popperjs/core": "^2.11.6",
      	...
    },
    ...
}

In case the error persists, try removing ‘node_modules’ folder and ‘package-lock.json‘ file, then execute npm install:

rm -rf node_modules
rm -f package-lock.json
npm install

Use the CDN

You can also use the CDN to install instead of running the commands as the above approach:

<!-- Version for Development -->
<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>

<!-- Version for Production -->
<script src="https://unpkg.com/@popperjs/core@2"></script>

Get the link in the code above. Ensure only to get the linked part and not the whole line of code. Paste that link into your web browser, and it gives us the code for ‘popper.js’. For instance, here is the code you receive on the browser:

In your project, create a file named popper.min.js. Copy all the code, paste it into that file, and then save it. So it looks like your installation is complete.

In some situations, it would help if you restart the development server and IDE before continuing to avoid unexpected errors.

Summary

I have showed you how to solve the error “Module not found: Can’t resolve ‘popper.js'”. You can follow along to fix it. Thank you for your reading in this article!

Maybe you are interested:

Leave a Reply

Your email address will not be published. Required fields are marked *