Fail to run a Fastify/ts app bundled by Webpack: “TypeError: Cannot destructure property ‘Serializer’ of ‘dependencies’ as it is undefined.”
I develop an app with node.js Fastify framework (typescript, ES syntax). I use Webpack to bundle the app and to compile typescript. I want to compile to commonjs to prevent compatibility issues. The app bundles successfully, but when I try to run the resulting bundle.cjs file, I get the following error: