I am getting the error in importing TILT from react. While working using Vite and react

2.9k views Asked by At

The requested module '/node_modules/.vite/deps/react-tilt.js?t=1681239019006&v=59c21aef' does not provide an export named 'default

I tried reinstalling tilt again using npm still it didnt make any difference

4

There are 4 answers

0
baljk On

Try this

import { Tilt } from 'react-tilt'

0
Sai Sheran On

use react-parallax-tilt instead of react-tilt and remove --legacy-peer-deps from the command. Also wherever you are using: import Tilt from "react-tilt", replace it with your new library like this: import Tilt from "react-parallax-tilt

0
yonatang0401 On

Uninstall the package with:

npm uninstall react-tilt

Then reinstalled it with:

npm install react-tilt

Then change the import to:

import { Tilt } from "react-tilt";

0
Michael React Mastery On

jst install it will work perfectly:

npm install react-tilt react react-dom