Coder Social home page Coder Social logo

Comments (2)

FrozenPandaz avatar FrozenPandaz commented on July 18, 2024 1

The short explanation is that a plugin failing to construct nodes means that Nx cannot properly construct a task graph for running any tasks. The plugin could have constructed a node which should have been depended upon by the task being run.

The long explanation is...

  • To run tasks, Nx creates a Task Graph.
  • The Task Graph is a function of the Project Graph. The definition of projects, and the relationships between them are used to create a task graph with relationships between tasks.
  • Nx uses plugins to construct the project graph based on config files in the repo.

So to put it all together in a concrete example...

A serve task you are running could be configured as such meaning that it depends on the build of any of it's dependencies:

{
  dependsOn: ['^build']
  ...
}

Now, we know.. there's no way that the jest plugin which only ever defines test targets is going to change this execution... but nothing specifies this to Nx.

So if the jest plugin fails to create nodes.. it could have failed to do any number of things it intended to do.

  1. It failed to create a test target totally unrelated to the serve task above (this is the reality)
  2. It failed to create a build target which would be related to the serve task above
  3. It creates a different serve target for that same project which would mean.. the target which should be run should be completely different if the plugin does not fail.

Ultimately, the Project Graph was not constructed properly.. and Nx is not sure what is missing and whether or not it is important to running the tasks. So Nx will error before running any task.

Does this make sense and answer your question as to why failing to parse a vite.config.js is a catastrophic failure?

As for the vite failure, if you have any more questions there, @Coly010 could maybe help you.

from nx.

ontoneio avatar ontoneio commented on July 18, 2024

I realize this could be specific to the UnoCSS from 'unocss/vite' imports configuration for exports, but what I am not understanding is why unrelated projects break with this and why I can't run things like nx report because of a simple import error in an unrelated project. I also kept seeing Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it. so I wanted to report the issue.

My vite config us using:

    commonjsOptions: {
      transformMixedEsModules: true,
    },

So I am not sure why such a small thing could break other projects.

from nx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.