Skip to content

Troubleshooting Vite

If you're using a framework like Vite and are running into build errors, check out some common errors below, and how to resolve them.

process is not defined

If you encounter an error like the one below:

Uncaught (in promise) ReferenceError: process is not defined at ../../../node_modules/@coinbase/wallet-sdk/dist/CoinbaseWalletSDK.js

This is due to an issue in one of Privy's necessary dependencies, the Coinbase Wallet SDK. You can read more about the issue here.

To resolve the issue, we recommend using the vite-plugin-node-polyfills package, which will polyfill the process dependency that Coinbase requires.

1. Install vite-plugin-node-polyfills

First, install vite-plugin-node-polyfills as a dev dependency:

sh
npm i --save-dev vite-plugin-node-polyfills

2. Update your vite.config.ts

Then, update your vite.config.ts file to include the following to use the plugin:

ts
import {defineConfig} from 'vite';
import {nodePolyfills} from 'vite-plugin-node-polyfills';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [nodePolyfills()],
});

That's it!

INFO

Still have questions? Reach out to support@privy.io – we're here to help!