Error during npm run build of vitejs react project #1261
devsalman247
announced in
Help
Replies: 2 comments
-
I've solved the build problem but now i'm having an error on console and empty auth modal is opening --> TypeError: Class extends value undefined is not a constructor or null
at torusEvmAdapter.esm.2a36d3f6.js:1:890 Here is updated vite config (This config runs locally successfully but not on deploy) --> import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill";
import nodePolyfills from "rollup-plugin-polyfill-node";
export default defineConfig({
plugins: [
react(),
],
server: {
port: 3000,
},
optimizeDeps: {
esbuildOptions: {
target: "es2020",
supported: { bigint: true },
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
NodeModulesPolyfillPlugin(),
],
},
},
build: {
target: "es2020",
outDir: "./build",
optimizeDeps: {
disabled: false,
},
commonjsOptions: {
transformMixedEsModules: true,
},
rollupOptions: {
plugins: [
nodePolyfills(),
],
},
},
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is fixed in 4.4.2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have configured my vite config as stated here https://web3auth.io/docs/troubleshooting/vite-issues
It runs the project at local server but during building for production it is giving me this error and I can't find solution
My ViteJS Config -->
Beta Was this translation helpful? Give feedback.
All reactions