Skip to content

Commit

Permalink
fix: not log ModuleNotFoundError
Browse files Browse the repository at this point in the history
  • Loading branch information
kaivean committed Dec 25, 2022
1 parent 76b2ece commit aa634c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/app-autoload/src/configLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ async function loadConfigModule(appRoot: string, subPath: string) {
const result = await loadModule(join(appRoot, `config/${subPath}`));
return result;
}
catch (e) {
console.error('load module error', e);
catch (e: any) {
if (e.constructor.name !== 'ModuleNotFoundError') {
console.error('load module error', e);
}
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async function runFastify(opts: Args) {
const rootEntryPath = join(rootPath, 'main.js');
let entryMod = null;
if (existsSync(rootEntryPath)) {
const entryMod = await loadModule(rootEntryPath);
entryMod = await loadModule(rootEntryPath);
entryMod[Symbol.for('skip-override')] = true;
}

Expand Down

0 comments on commit aa634c2

Please sign in to comment.