score:0

i guess you can dynamically import ts files in nextjs with some workarounds.

import dynamic from "next/dynamic";
...
...
const button = dynamic(() => import("../components/button").then(module => module.default));

if you want to read further https://github.com/vercel/next.js/issues/4515


Related Query

More Query from same tag