Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

'Buffer' is not exported by __vite-browser-external:buffer

$
0
0

I'm getting this build error with vite and sveltekit using adapter-node

I'm not sure why it won't build since it relies on node to server the client.

dev works fine

'Buffer' is not exported by __vite-browser-external:buffer

I tried polyfills but they don't work.

            optimizeDeps: {                esbuildOptions: {                    // Node.js global to browser globalThis                    define: {                        global: 'globalThis'                    },                    // Enable esbuild polyfill plugins                    plugins: [                        NodeGlobalsPolyfillPlugin({                            process: true,                            buffer: true,                            webworkers: true,                        }),                        NodeModulesPolyfillPlugin()                    ]                }            },            build: {                minify: true,                rollupOptions: {                    plugins: [                        // Enable rollup polyfills plugin                        // used during production bundling                        rollupNodePolyFill()                    ]                }            }

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>