Please put the buffer and process in the index.html and remove it from here.
The index.html will look like this:
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Include these lines for polyfills -->
<script type="module">
import { Buffer } from "buffer";
import process from "process";
window.Buffer = Buffer;
window.process = process;
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<!-- Optionally, you can rename index.tsx to main.tsx to be consistent with Vite folder structure. -->
</body>
</html>
Thanks @shahbaz for the reply. I did fix this issue. Now i am facing an issue where i migrated my app from create-react-app to create-vite-app and i had a google login verifier and i had whitelisted http://localhost:3000/serviceworker/redirect so that it is redirected here when the user logs in with google. Now in the vite app , i am getting this error
Could you please click on the error_details and provide the redirectURI? Also, make sure to whitelist the redirectURI on the Google Cloud console dashboard of your project.