React Build it not working
I tried to depoy React version (demo7) on vercel but it seems to be not working. I tried with both the edited version and the freshly downloaded version, and both seemed to show the same issue/error.
Fresh Install -
Edited Version -
None of them are working after deployment but these are working well on the dev mode in local host. How do i fix this issue?
Replies (4)
Hi Advith,
Sorry for the delay.
If you are using Metronic v8.2.0 or lower versions with CRA, you need to update the homepage property in package.json.
"homepage": "/", Regards,
Lauris Stepanovs,
Keenthemes Support Team
There is no file called "vite.config.ts" i checked with both edited version and fresh installed source file.
Hi Advith,
Thank you for reaching out to us.
On your previews, I see that images are still referring /metronic8/react/demo6/ which means that you haven't updated the base path property in vite.config.ts.
To fix this problem do the following:
- Update base property to from /metronic8/react/demo6/ to / in vite.config.ts.
- Globally in your project find and replace
toAbsoluteUrl('/withtoAbsoluteUrl('. - Rebuild and redeploy your project.
Regards,
Lauris Stepanovs,
Keenthemes Support Team