In your remix.config.js, rename serverBuildDirectory to serverBuildPath and specify a module path, not a directory.
Before
/** @type {import('@remix-run/dev').AppConfig} */module.exports = {serverBuildDirectory: './build',};
After
/** @type {import('@remix-run/dev').AppConfig} */module.exports = {serverBuildPath: './build/index.js',};
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community