diff --git a/common/changes/@rushstack/heft-rspack-plugin/bmiddha-rspack-config-load_2025-11-21-22-35.json b/common/changes/@rushstack/heft-rspack-plugin/bmiddha-rspack-config-load_2025-11-21-22-35.json new file mode 100644 index 00000000000..0af39f23ca2 --- /dev/null +++ b/common/changes/@rushstack/heft-rspack-plugin/bmiddha-rspack-config-load_2025-11-21-22-35.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-rspack-plugin", + "comment": "Fix issue where ignoring ERR_MODULE_NOT_FOUND errors when importing the rspack config masks legitimate import issues.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-rspack-plugin" +} \ No newline at end of file diff --git a/heft-plugins/heft-rspack-plugin/src/RspackConfigurationLoader.ts b/heft-plugins/heft-rspack-plugin/src/RspackConfigurationLoader.ts index 3864f08dc6f..98a6d37fdcf 100644 --- a/heft-plugins/heft-rspack-plugin/src/RspackConfigurationLoader.ts +++ b/heft-plugins/heft-rspack-plugin/src/RspackConfigurationLoader.ts @@ -177,11 +177,6 @@ export async function _tryLoadRspackConfigurationFileInnerAsync( const configurationUri: string = pathToFileURL(configurationPath).href; return await import(configurationUri); } catch (e) { - const error: NodeJS.ErrnoException = e as NodeJS.ErrnoException; - if (error.code === 'ERR_MODULE_NOT_FOUND') { - // No configuration found, return undefined. - return undefined; - } throw new Error(`Error loading Rspack configuration at "${configurationPath}": ${e}`); } } else {