I am trying to build a React, Tailwind, Vite project on github pages. I have deployed projects before and not ran into any issues but I am getting this issue on build –
Rollup failed to resolve import "framer-motion" from "/home/runner/work/Refine/Refine/src/components/ Services ".
I have been trying to debug for a few hours now.
The repo link is https://github.com/JaredFunaro/Refine
I believe you can view the action reports to get a better idea of what is going on, any help would be greatly appreciated. Thankyou
2
Answers
So it wasn't able to find the css and other files because I forgot to add the 'base' option in vite config for deployment!
my original vite.config.js file was -
I just had to update the base option to reflect the name of github repo, so the github repo was named "Refine" so I updated the vite.config.js file to say -
Looks like you are importing
framer-motion
but is not listed as a dependency.Simple install it by running: