Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nx serve fails running the project. #28371

Closed
2 of 4 tasks
edvardma opened this issue Oct 9, 2024 · 5 comments · Fixed by #28443
Closed
2 of 4 tasks

nx serve fails running the project. #28371

edvardma opened this issue Oct 9, 2024 · 5 comments · Fixed by #28443
Assignees
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug

Comments

@edvardma
Copy link

edvardma commented Oct 9, 2024

Current Behavior

Hi, I developed my MFE application using nx. I keep getting this error when starting serve or building. Please help me out.

Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

The issue persists after running nx reset and that's why I'm reporting here.

Expected Behavior

after running nx serve-host [host or appName] , serve the project on 4200 or etc.

GitHub Repo

https://github.com/edvardma/project

Steps to Reproduce

  1. nx serve-host host
  2. nx serve-host [app name]

Nx Report

nx report  1 ✘  system 

NX Report complete - copy this into the issue template

Node : 20.17.0
OS : darwin-arm64
Native Target : aarch64-macos
pnpm : 9.12.1

nx (global) : 19.2.2
nx : 19.6.5
@nx/js : 19.8.0
@nx/jest : 19.6.5
@nx/eslint : 19.6.5
@nx/workspace : 19.6.5
@nx/eslint-plugin : 19.6.5
@nx/react : 19.6.5
@nx/vite : 19.8.0
@nrwl/vite : 19.6.5
@nx/vue : 19.8.0
@nx/web : 19.8.0
@nx/webpack : 19.6.5
typescript : 5.5.4

Registered Plugins:
@nx/vite/plugin
@nx/eslint/plugin

The following packages should match the installed version of nx

To fix this, run nx migrate [email protected]

Failure Logs

Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

Pass --verbose to see the stacktraces.

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@e-oz
Copy link

e-oz commented Oct 9, 2024

You could try adding “--verbose” to see the reason.

@edvardma
Copy link
Author

edvardma commented Oct 9, 2024

Thanks @e-oz for your comment, this is what I get after --verbose. But still can't figure the problem out.

Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

  The "nx/js/dependencies-and-lockfile" plugin threw an error while creating dependencies:

    Error: "Unable to load /Users/edvard/labs/v2/project/apps/vue-app/vite.config.mts.timestamp-1728452906443-9f9ff60e9db2a.mjs: No such file or directory (os error 2)\nUnable to load /Users/edvard/labs/v2/project/apps/invoices/vite.config.mts.timestamp-1728452906441-0956df084d791.mjs: No such file or directory (os error 2)\nUnable to load /Users/edvard/labs/v2/project/apps/host/vite.config.mts.timestamp-1728452906439-9187bc3856d11.mjs: No such file or directory (os error 2)"
        at buildExplicitTypeScriptDependencies (/Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js:50:21)
        at buildExplicitDependencies (/Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/plugins/js/project-graph/build-dependencies/build-dependencies.js:32:120)
        at Object.createDependencies (/Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/plugins/js/index.js:81:92)
        at LoadedNxPlugin.createDependencies (/Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/project-graph/plugins/internal-api.js:60:59)
        at createDependencies (/Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker.js:88:49)
        at consumeMessage (/Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/project-graph/plugins/isolation/messaging.js:38:32)
        at /Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker.js:21:47
        at Socket.<anonymous> (/Users/edvard/labs/v2/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected]__@[email protected]_ty_q57b7p7vk6b3yhorxjo3xgfo3q/node_modules/nx/src/utils/consume-messages-from-socket.js:13:17)
        at Socket.emit (node:events:519:28)
        at addChunk (node:internal/streams/readable:559:12)

@Coly010 Coly010 self-assigned this Oct 9, 2024
@Coly010 Coly010 added scope: module federation Issues related to module federation support scope: bundlers Issues related to webpack, rollup and removed scope: module federation Issues related to module federation support labels Oct 9, 2024
@Coly010
Copy link
Contributor

Coly010 commented Oct 9, 2024

@edvardma Looks like you have a vite timestamp file that never got cleaned up. It only exists on your local and not in the repo you linked. I couldn't reproduce the issue when I ran it.

It could be related to the serve-host command running a bunch of vite commands serially.

I'd attempt to potentially run them in a single command such as:

nx run myproject:serve & nx run vueapp:serve etc.

I think there might still be something we can do on our side to avoid loading the timestamp files

@edvardma
Copy link
Author

@Coly010 Thank you for looking into this. I tried deleting and git clone and reinstalling everything again, but the issue persists.

Although I have tried running the suggested approach with the:
nx run myproject:serve & nx run vueapp:serve and still get Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

If there’s anything you can do on your side to prevent loading the timestamp files, that would be great. Let me know if you need more details from my end.

Thanks again for your help!

jaysoo pushed a commit that referenced this issue Oct 17, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When Vite's tries to handle a `.ts` config file it builds it to JS with
a `.timestamp-` suffix. These files are still picked up by Nx when they
shouldn't as it's a temp file
(vitejs/vite#13267).



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add these temp files to gitignore to prevent processing.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28371
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants