diff --git a/nuxt.config.ts b/nuxt.config.ts index 2243c8c30..50e639c40 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -62,12 +62,17 @@ export default defineNuxtConfig({ plugins: ['~/plugins/buffer.ts'], + alias: { + // polyfill process + process: 'unenv/runtime/node/process' + }, vite: { define: { global: 'globalThis' }, plugins: [ nodePolyfills({ + // global breaks on dev globals: { process: false, Buffer: false, diff --git a/plugins/buffer.ts b/plugins/buffer.ts index 579cd4f9a..d8efaffc4 100644 --- a/plugins/buffer.ts +++ b/plugins/buffer.ts @@ -1,6 +1,8 @@ import { Buffer } from 'buffer' +import process from 'node:process' globalThis.Buffer = Buffer +globalThis.process = process export default defineNuxtPlugin((_) => { })