Skip to content

Conversation

@MaxKless
Copy link
Collaborator

@MaxKless MaxKless commented Oct 8, 2025

  • initial impl wip
  • handle with proper writing of lock file wip

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

@netlify
Copy link

netlify bot commented Oct 8, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 29491ef
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/68ff7a903b4ff200083d2abe
😎 Deploy Preview https://deploy-preview-33021--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.

@vercel
Copy link

vercel bot commented Oct 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Oct 27, 2025 2:16pm

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Oct 8, 2025

View your CI Pipeline Execution ↗ for commit 29491ef

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 3m 6s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 9s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 10s 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 2025-10-27 16:22:06 UTC

@github-actions
Copy link
Contributor

Failed to publish a PR release of this pull request, triggered by @MaxKless.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/18839701920

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.

Nx Cloud is proposing a fix for your failed CI:

These changes fix a critical error where the vite plugin attempted to access properties on an undefined variable. We've resolved the scope issue by moving projectRootFromWorkspaceRoot from module-level to local scope within configResolved, and corrected the getTsConfig function to use the absolute projectRoot path directly rather than a relative path that needed rejoining with workspace root.

We could not verify this fix.

Suggested Fix changes
diff --git a/packages/vite/plugins/nx-tsconfig-paths.plugin.ts b/packages/vite/plugins/nx-tsconfig-paths.plugin.ts
index 4bb8e3e83e..415d0f3f8f 100644
--- a/packages/vite/plugins/nx-tsconfig-paths.plugin.ts
+++ b/packages/vite/plugins/nx-tsconfig-paths.plugin.ts
@@ -72,7 +72,6 @@ export function nxViteTsPaths(options: nxViteTsPathsOptions = {}) {
   options.mainFields ??= [['exports', '.', 'import'], 'module', 'main'];
   options.buildLibsFromSource ??= true;
   let projectRoot = '';
-  let projectRootFromWorkspaceRoot: string;
 
   return {
     name: 'nx-vite-ts-paths',
@@ -81,7 +80,7 @@ export function nxViteTsPaths(options: nxViteTsPathsOptions = {}) {
     enforce: 'pre',
     async configResolved(config: any) {
       projectRoot = config.root;
-      projectRootFromWorkspaceRoot = relative(workspaceRoot, projectRoot);
+      const projectRootFromWorkspaceRoot = relative(workspaceRoot, projectRoot);
       foundTsConfigPath = getTsConfig(
         process.env.NX_TSCONFIG_PATH ??
           join(
@@ -217,14 +216,10 @@ export function nxViteTsPaths(options: nxViteTsPathsOptions = {}) {
   } as Plugin;
 
   function getTsConfig(preferredTsConfigPath: string): string {
-    const projectTsConfigPath = getProjectTsConfigPath(
-      projectRootFromWorkspaceRoot
-    );
+    const projectTsConfigPath = getProjectTsConfigPath(projectRoot);
     return [
       resolve(preferredTsConfigPath),
-      projectTsConfigPath
-        ? resolve(join(workspaceRoot, projectTsConfigPath))
-        : null,
+      projectTsConfigPath ? resolve(projectTsConfigPath) : null,
       resolve(join(workspaceRoot, 'tsconfig.base.json')),
       resolve(join(workspaceRoot, 'tsconfig.json')),
       resolve(join(workspaceRoot, 'jsconfig.json')),

Apply fix via Nx Cloud  Reject fix via Nx Cloud

Or Apply changes locally with:

npx nx-cloud apply-locally YxZJ-yAkb

Apply fix locally with your editor ↗  View interactive diff ↗


🎓 To learn more about Self Healing CI, please visit nx.dev

@github-actions
Copy link
Contributor

Failed to publish a PR release of this pull request, triggered by @MaxKless.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/18848659618

@github-actions
Copy link
Contributor

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-33021-29491ef
Release details 📑
Published version 0.0.0-pr-33021-29491ef
Triggered by @MaxKless
Branch native-lock-file
Commit 29491ef
Workflow run 18871421539

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

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