I'm working on a tiny next.js project, but the issue that i'm facing is that ES6 module import only works in React components.The 2 following code are some Database configurations that are used in routes inside API folder.
The code below is the one that doesn't work using ES6 modules

Here is the code that works fine with common js

Also when i use the debugger, with the code using ES6 modules, i cannot capture values form imported modules and i only capture values when using common js.
I've tried to solve the problem with this github issue : Support ES module in next.config.js but id did not help. Have any idea?