Skip to content

Commit

Permalink
fix(nxls): always provide at least empty project graph object (#2358)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKless authored Dec 11, 2024
1 parent 6357105 commit 504ef56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function getNxWorkspaceConfig(
nxVersion: NxVersion,
logger: Logger
): Promise<{
projectGraph: ProjectGraph;
projectGraph: ProjectGraph | undefined;
sourceMaps: ConfigurationSourceMaps | undefined;
nxJson: NxJsonConfiguration;
projectFileMap: ProjectFileMap | undefined;
Expand Down
5 changes: 4 additions & 1 deletion libs/language-server/workspace/src/lib/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ async function _workspace(
const isLerna = await fileExists(join(workspacePath, 'lerna.json'));

return {
projectGraph,
projectGraph: projectGraph ?? {
nodes: {},
dependencies: {},
},
sourceMaps,
nxJson,
projectFileMap,
Expand Down

0 comments on commit 504ef56

Please sign in to comment.