adrianhajdin / project_3D_developer_portfolio

The most impressive websites in the world use 3D graphics and animations to bring their content to life. Learn how to build your own ThreeJS 3D Developer Portfolio today!
https://jsmastery.pro
5.81k stars 1.29k forks source link

[SOLVE] Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/react-tilt.js?v=d6d8354a' does not provide an export named 'default' (at About.jsx:2:8) #70

Closed louloudev59 closed 1 year ago

louloudev59 commented 1 year ago

Hello, when i started the website with npm run dev, everything works but the web page displayed is completely blank and in the browser console, I have this error: Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/react-tilt.js?v=d6d8354a' does not provide an export named 'default' (at About.jsx:2:8)

how to fix the bug??

THANKS

louloudev59 commented 1 year ago

Same, if you have found the solution please lmk

UPDATE: i found the solution: https://stackoverflow.com/questions/75989922/i-am-getting-the-error-in-importing-tilt-from-react-while-working-using-vite-an

Uninstall the package with:

npm uninstall react-tilt

Then reinstalled it with:

npm install react-tilt

Then change the import in About.jsx and Works.jsx to:

import { Tilt } from "react-tilt";

thanks a lot

ghost commented 1 year ago

Hello, when i started the website with npm run dev, everything works but the web page displayed is completely blank and in the browser console, I have this error: Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/react-tilt.js?v=d6d8354a' does not provide an export named 'default' (at About.jsx:2:8)

how to fix the bug??

THANKS

issue solved : try importing tilt as : import { Tilt } from "react-tilt";

Satvik77 commented 1 year ago

Just need to replace Tilt to {Tilt} , no extra steps needed