Skip to content

fix(nx-dev): build nx-dev in-place to fix ai package resolution#34730

Merged
jaysoo merged 3 commits intomasterfrom
DOC-418
Mar 20, 2026
Merged

fix(nx-dev): build nx-dev in-place to fix ai package resolution#34730
jaysoo merged 3 commits intomasterfrom
DOC-418

Conversation

@jaysoo
Copy link
Member

@jaysoo jaysoo commented Mar 6, 2026

Current Behavior

The default @nx/next:build for nx-dev outputs to dist/nx-dev/nx-dev. At runtime, Node.js can't resolve the ai package from that path because node_modules is at the workspace root — causing ERR_MODULE_NOT_FOUND on /ai-chat.

Additionally, ui-video-courses is missing @nx/nx-dev-ui-icons as a dependency (introduced by #34669), causing a webpack compilation failure.

Expected Behavior

Build in-place to nx-dev/nx-dev (matching the existing Netlify config) so .next stays close to node_modules and package resolution works. This also simplifies config by removing the Netlify vs Vercel branching in sitemap scripts and project.json configurations.

Other Notes

This PR also:

  • Redirects / to /blog since almost everything else, including homepage, are in Framer.
  • Uses @nx/next/plugin to infer targets now so we no longer use any @nx/next:* executors.
  • Cleans up nx-dev project config so it no longer has serve-docs and other weird setup. It is purely just nx dev nx-dev or nx build nx-dev or nx start nx-dev like a normal Next.js app.
  • Removes extra NETLIFY env var checks to point outputs in different places.

Related Issue(s)

Closes DOC-418

@jaysoo jaysoo requested review from a team, FrozenPandaz and vsavkin as code owners March 6, 2026 00:52
@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 8d5cfe1
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69bd8e84d23b46000882208b
😎 Deploy Preview https://deploy-preview-34730--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 8d5cfe1
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69bd8e8474f0480008ea6731
😎 Deploy Preview https://deploy-preview-34730--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jaysoo jaysoo changed the title fix(nx-dev): build nx-dev in-place to fix ai package resolution docs(nx-dev): build nx-dev in-place to fix ai package resolution Mar 6, 2026
@nx-cloud
Copy link
Contributor

nx-cloud bot commented Mar 6, 2026

View your CI Pipeline Execution ↗ for commit 8d5cfe1

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 12m 2s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 9s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 7s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-20 18:35:45 UTC

@jaysoo jaysoo changed the title docs(nx-dev): build nx-dev in-place to fix ai package resolution fix(nx-dev): build nx-dev in-place to fix ai package resolution Mar 6, 2026
nx-cloud[bot]

This comment was marked as outdated.

@jaysoo jaysoo force-pushed the DOC-418 branch 7 times, most recently from 252402a to 36d85ee Compare March 6, 2026 19:22
@jaysoo jaysoo requested a review from a team as a code owner March 17, 2026 20:24
@jaysoo jaysoo force-pushed the DOC-418 branch 2 times, most recently from 90cba0b to 892a9e4 Compare March 17, 2026 20:38
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@jaysoo jaysoo force-pushed the DOC-418 branch 2 times, most recently from d3adf25 to dfe5911 Compare March 18, 2026 14:41
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@jaysoo jaysoo force-pushed the DOC-418 branch 2 times, most recently from 2692b99 to 6b12d85 Compare March 19, 2026 20:47
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

The default @nx/next:build for nx-dev outputs to dist/nx-dev/nx-dev.
At runtime, Node.js can't resolve the ai package from that path because
node_modules is at the workspace root, causing ERR_MODULE_NOT_FOUND on
/ai-chat. Additionally, ui-video-courses is missing @nx/nx-dev-ui-icons
as a dependency.

Build in-place so .next stays close to node_modules and package
resolution works. Clean up and simplify nx-dev targets. Fix missing
dependency in ui-video-courses.

Fixes DOC-418
The default @nx/next:build for nx-dev outputs to dist/nx-dev/nx-dev.
At runtime, Node.js can't resolve the ai package from that path because
node_modules is at the workspace root, causing ERR_MODULE_NOT_FOUND on
/ai-chat. Additionally, ui-video-courses is missing @nx/nx-dev-ui-icons
as a dependency.

Build in-place so .next stays close to node_modules and package
resolution works. Clean up and simplify nx-dev targets. Fix missing
dependency in ui-video-courses.

Fixes DOC-418 [Self-Healing CI Rerun]
nx-cloud[bot]

This comment was marked as outdated.

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ The fix from Nx Cloud was applied

We updated the check-links target's dependsOn from nx-dev:next:build to nx-dev:sitemap to fix the missing sitemap error. The PR's refactor removed the old build target that previously triggered sitemap generation, leaving check-links with a dependency that doesn't produce the required sitemap.xml. This change restores the correct execution order: Next.js build → sitemap generation → link checking.

Tip

We verified this fix by re-running nx-dev:check-links, astro-docs:e2e-ci--e2e/devkit-urls-fragments.spec.ts.

Suggested Fix changes
diff --git a/nx-dev/nx-dev/project.json b/nx-dev/nx-dev/project.json
index bc98029aa7..db158df888 100644
--- a/nx-dev/nx-dev/project.json
+++ b/nx-dev/nx-dev/project.json
@@ -84,8 +84,11 @@
     },
     "check-links": {
       "cache": true,
-      "dependsOn": ["nx-dev:next:build", "astro-docs:build"],
-      "command": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/internal-link-checker.ts",
+      "dependsOn": ["nx-dev:sitemap", "astro-docs:build"],
+      "executor": "nx:run-commands",
+      "options": {
+        "command": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/internal-link-checker.ts"
+      },
       "inputs": [
         "{workspaceRoot}/docs/**/*",
         { "dependentTasksOutputFiles": "**/sitemap*.xml" },

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.

Revert fix via Nx Cloud  

View interactive diff ↗

🎓 Learn more about Self-Healing CI on nx.dev

Co-authored-by: jaysoo <jaysoo@users.noreply.github.com>
@jaysoo jaysoo merged commit 30d64c4 into master Mar 20, 2026
23 checks passed
@jaysoo jaysoo deleted the DOC-418 branch March 20, 2026 18:33
jaysoo added a commit that referenced this pull request Mar 20, 2026
## Current Behavior

The default `@nx/next:build` for nx-dev outputs to `dist/nx-dev/nx-dev`.
At runtime, Node.js can't resolve the `ai` package from that path
because `node_modules` is at the workspace root — causing
`ERR_MODULE_NOT_FOUND` on `/ai-chat`.

Additionally, `ui-video-courses` is missing `@nx/nx-dev-ui-icons` as a
dependency (introduced by #34669), causing a webpack compilation
failure.

## Expected Behavior

Build in-place to `nx-dev/nx-dev` (matching the existing Netlify config)
so `.next` stays close to `node_modules` and package resolution works.
This also simplifies config by removing the Netlify vs Vercel branching
in sitemap scripts and project.json configurations.


## Other Notes

This PR also:
- Redirects `/` to `/blog` since almost everything else, including
homepage, are in Framer.
- Uses `@nx/next/plugin` to infer targets now so we no longer use any
`@nx/next:*` executors.
- Cleans up `nx-dev` project config so it no longer has `serve-docs` and
other weird setup. It is purely just `nx dev nx-dev` or `nx build
nx-dev` or `nx start nx-dev` like a normal Next.js app.
- Removes extra `NETLIFY` env var checks to point outputs in different
places.

## Related Issue(s)

Closes DOC-418

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: jaysoo <jaysoo@users.noreply.github.com>
jaysoo added a commit that referenced this pull request Mar 20, 2026
## Current Behavior

The default `@nx/next:build` for nx-dev outputs to `dist/nx-dev/nx-dev`.
At runtime, Node.js can't resolve the `ai` package from that path
because `node_modules` is at the workspace root — causing
`ERR_MODULE_NOT_FOUND` on `/ai-chat`.

Additionally, `ui-video-courses` is missing `@nx/nx-dev-ui-icons` as a
dependency (introduced by #34669), causing a webpack compilation
failure.

## Expected Behavior

Build in-place to `nx-dev/nx-dev` (matching the existing Netlify config)
so `.next` stays close to `node_modules` and package resolution works.
This also simplifies config by removing the Netlify vs Vercel branching
in sitemap scripts and project.json configurations.


## Other Notes

This PR also:
- Redirects `/` to `/blog` since almost everything else, including
homepage, are in Framer.
- Uses `@nx/next/plugin` to infer targets now so we no longer use any
`@nx/next:*` executors.
- Cleans up `nx-dev` project config so it no longer has `serve-docs` and
other weird setup. It is purely just `nx dev nx-dev` or `nx build
nx-dev` or `nx start nx-dev` like a normal Next.js app.
- Removes extra `NETLIFY` env var checks to point outputs in different
places.

## Related Issue(s)

Closes DOC-418

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: jaysoo <jaysoo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants