Skip to content

Commit

Permalink
fix(core): correct log message when uninstalled plugin is referenced …
Browse files Browse the repository at this point in the history
…in nx.json

Fixes nrwl#9976
  • Loading branch information
AgentEnder committed Apr 25, 2022
1 parent 2cde4fb commit bed22ac
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/nx/src/utils/nx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
WorkspaceJsonConfiguration,
} from '../config/workspace-json-project-json';
import { findMatchingProjectForPath } from './target-project-locator';
import { logger } from './logger';

export type ProjectTargetConfigurator = (
file: string
Expand Down Expand Up @@ -54,10 +55,16 @@ export function loadNxPlugins(
} catch (e) {
if (e.code === 'MODULE_NOT_FOUND') {
const plugin = resolveLocalNxPlugin(moduleName);
const main = readPluginMainFromProjectConfiguration(
plugin.projectConfig
);
pluginPath = main ? path.join(workspaceRoot, main) : plugin.path;
if (plugin) {
const main = readPluginMainFromProjectConfiguration(
plugin.projectConfig
);
pluginPath = main ? path.join(workspaceRoot, main) : plugin.path;
}
else {
logger.error(`Plugin listed in \`nx.json\` not found: ${moduleName}`)
throw e;
}
} else {
throw e;
}
Expand Down

0 comments on commit bed22ac

Please sign in to comment.