I had this error in my pipeline aws: Module level directives cause errors when bundled, 'use client' was ignored causing JavaScript heap out of memory
I want a solution for this problem considering that i am using vite.js on my react.js app.
to resolve this question I used 2 steps:
add this code into vite.config.js:
export default defineConfig({
build: {
chunkSizeWarningLimit: 100,
rollupOptions: {
onwarn(warning, warn) {
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
return;
}
warn(warning);
},
},
},
plugins: [react()],
});
I used this config in my AWS pipeline: https://stackoverflow.com/a/66889948/13507783
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With