diff --git a/.changeset/swift-phones-cheat.md b/.changeset/swift-phones-cheat.md new file mode 100644 index 0000000000..97697ad916 --- /dev/null +++ b/.changeset/swift-phones-cheat.md @@ -0,0 +1,12 @@ +--- +'@backstage/cli': minor +--- + +Removed `tsx` and `jsx` as supported extensions in backend packages. For most +repos, this will not have any effect. But if you inadvertently had added some +`tsx`/`jsx` files to your backend package, you may now start to see `code: 'MODULE_NOT_FOUND'` errors when launching the backend locally. The reason for +this is that the offending files get ignored during transpilation. Hence, the +importing file can no longer find anything to import. + +The fix is to rename any `.tsx` files in your backend packages to `.ts` instead, +or `.jsx` to `.js`. diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index 0d4649fa3f..1974153f02 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -267,7 +267,7 @@ export async function createBackendConfig( paths.targetRunFile ? paths.targetRunFile : paths.targetEntry, ], resolve: { - extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json'], + extensions: ['.ts', '.mjs', '.js', '.json'], mainFields: ['main'], modules: [paths.rootNodeModules, ...moduleDirs], plugins: [