Skip to content

Commit

Permalink
fix(nextjs): avoid path error on dev server creation
Browse files Browse the repository at this point in the history
  • Loading branch information
weberjavi authored and ndcunningham committed Mar 4, 2024
1 parent 8ccdd73 commit 824ea8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/src/executors/server/server.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default async function* serveExecutor(
);
const projectRoot = context.workspace.projects[context.projectName].root;
// This is required for the default custom server to work. See the @nx/next:app generator.
const nextDir = resolve(context.root, buildOptions.outputPath);
const nextDir =
!options.dev && resolve(context.root, buildOptions.outputPath);
process.env.NX_NEXT_DIR ??= options.dev ? projectRoot : nextDir;

if (options.customServerTarget) {
Expand Down

0 comments on commit 824ea8c

Please sign in to comment.