From d5f9caee0ff6b3890de70e1f525ea793d79c3444 Mon Sep 17 00:00:00 2001 From: Timothy Asquith Date: Tue, 25 Feb 2020 10:52:55 +1100 Subject: [PATCH] Missing exports errors now print the importing module Prior to this change, we only printed the imported module that failed, with no context on which module was attempting the import. This could be difficult to debug in large codebases, especially when importing commonly-used modules. --- src/Module.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Module.ts b/src/Module.ts index 2e194f552e9..0b0bc181840 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -157,7 +157,9 @@ function handleMissingExport( return importingModule.error( { code: 'MISSING_EXPORT', - message: `'${exportName}' is not exported by ${relativeId(importedModule)}`, + message: `'${exportName}' is not exported by ${relativeId( + importedModule + )}, importing module: ${importingModule.id}`, url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` }, importerStart!