T3 Stack + custom Next.js server not working

Hi, I'm using t3 stack and trying to leverage Next.js custom server. But, unfortunately when I'm trying to run it using ts-node I'm constantly getting an error connected to module resolution (I guess it's because my next.config.mjs has .mjs extension):
[1] Error [ERR_REQUIRE_ESM]: require() of ES Module next.config.mjs not supported.
[1] Instead change the require of next.config.mjs to a dynamic import() which is available in all CommonJS modules.

What should I do to fix this? Here's the full code:
https://github.com/Bartek532/rssmarkable/pull/40

Thanks in advance for all suggestions! πŸ™‚
Was this page helpful?