This one is doing my head in. My local build works fine, but when I push to Vercel the deployment fails and I get this error “Module not found: Can’t resolve ‘@/scripts/fadeInElements'”.
This is what I’m using to input the script
import fadeInElements from '@/scripts/fadeInElements'
And this is the script at this stage
export default function fadeInElements() {
let pElements = document.querySelectorAll('p')
console.log(pElements)
}
Ah, actually, this fixed it. Not sure what happened
git rm -r --cached .
git add --all .
git commit -a -m "Versioning untracked files"
git push origin master