Soplve [nuxt] error caught during app initialization Error: process is not defined

I had facing this error with Nuxt3, in my deployed Vercel app. Because library implemented @web3auth/... has some polyfill issues to solve.

First I needed to install packages pnpm add --save-dev buffer process, Then I call them in my layout by default.


<script type="module" lang="ts">

// Global node polyfill.

import { Buffer } from "buffer";

import process from "process";

window.global = window;

window.Buffer = Buffer;

window.process = process;

</script>

@mariasf Welcome Aboard!

Your issue has been forwarded to our team and we will get back to you with further updates once more information becomes available.