I m using Vite+React,

while doing npm run build I m getting this error how to resolve this ?

"TextEncoder" is not exported by "__vite-browser-external", imported by "node_modules/axios/lib/helpers/formDataToStream.js"

I have latest version of vite and axios installed and this is my config

import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";

export default defineConfig({
  server: {
    port: 3000,
  },
  plugins: [react()],

  resolve: {
    // for react-moment pkg to solve undefined format error
    mainFields: [],
  },
});
        
0

There are 0 best solutions below