mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
fix: improve plugin import error (#1674)
This commit is contained in:
5
.changeset/seven-rocks-laugh.md
Normal file
5
.changeset/seven-rocks-laugh.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@redocly/cli": patch
|
||||
---
|
||||
|
||||
Get more helpful error messages when there's a problem importing a plugin.
|
||||
@@ -155,10 +155,7 @@ export async function resolvePlugins(
|
||||
return mod.default || mod;
|
||||
}
|
||||
} catch (e) {
|
||||
if (e instanceof SyntaxError) {
|
||||
throw e;
|
||||
}
|
||||
throw new Error(`Failed to load plugin "${plugin}". Please provide a valid path`);
|
||||
throw new Error(`Failed to load plugin "${plugin}": ${e.message}\n\n${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user