How to resolve this build error while building a widget - Module level directives cause errors when bundled, use client was ignored.

2
I created a project in Mendix 10.0.0 using Javascript ES6. I have added antd as dependency. When I’m trying to build this project after adding antd I’m getting this error –  node_modules\antd\es\index.js (1:0) Error: Module level directives cause errors when bundled, 'use client' was ignored.1: "use client"; ^ 2: 3: export { default as Affix } from './affix'; How do I resolve this. I’ve tried upgrading, downgrading react but it doesn’t work.
asked
4 answers
3

on node module, @mendix folder, find rollup.config.js change onwarn with

onwarn(warning, warn) {                if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {                  return

                }

                warn(warning)

              }

Then you can build the widget

answered
1

Do as Quang said,And I can build the widget

image.png

answered
0

Me too ~ so many error~

answered
0

I meet this error too

answered