Skip to content

Commit

Permalink
Fail explicitly when initializer does not have default export
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehul Kar committed Nov 5, 2020
1 parent b69de85 commit 7b3abdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function resolveInitializer(moduleName: string) {
throw new Error(moduleName + ' must export an initializer.');
}
var initializer = module['default'];
if (!initializer) {
throw new Error(moduleName + ' must have a default export');
}
if (!initializer.name) {
initializer.name = moduleName.slice(moduleName.lastIndexOf('/') + 1);
}
Expand Down

0 comments on commit 7b3abdb

Please sign in to comment.