-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 report
results in "Failed to process project graph. Run "nx reset" to fix this"
#23296
Comments
Let me take a closer look at what is causing the plugin graph to fail during creation and I'll update here again |
Hey @beeman ! So it's a true error, it's just a little bit hidden unfortunately. The error comes from the It's trying to set console.log("config.resolve", config.resolve);
config.resolve.fallback = {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
}; output:
Changing that section to: config.resolve ??= {};
config.resolve.fallback = {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
}; Allows it to work:
To uncover errors like these, you can run |
It also happens after installing a second app. After I do a successful: "nx g @nx/react:app website" all is fine But then when I try to add another app: "nx g @nx/express:app api" then I see this error: "NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it." This is a blocker and should be treated as urgent. It's impossible to use NX at this point to create a functional application. |
Thanks for checking this @Coly010 . I don't think this should be closed, as it's a regression. The same The previous and expected behavior is that these webpack options are merged. With that in mind, it only makes sense that it would create any missing parent keys.
This is very useful, thanks. I've been getting these errors all the time lately and never knew how to debug it! |
Hi @beeman :) The repo you linked in the latest comment doesn't using Inference Plugins, therefore the webpack.config.js files are not being resolved. If you set the webpack plugin in the pubkey repo, and run Therefore, I would not say this is a regression. When resolving the webpack config, which in this case returns a function which takes a config object and transforms it, we pass an empty object as the starting point for the config, which is then built up over time. There are some config options that are only set during the actual build when using |
…23296 (#23368) <!-- 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` --> ## Current Behavior <!-- This is the behavior we have today --> The `@nx/webpack/plugin` will resolve and read webpack options from user defined config files. However, it does not set the env vars indicating that a task is being run, because tasks are not being run at this stage. This means that certain config properties are not being set by `applyBaseConfig`. Users' webpack configs may rely on these properties being set so they can modify them. When not set, this throws, meaning the graph cannot be constructed. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Initialize the properties that we usually set when `applyBaseConfig` is used. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23296
…23296 (#23368) <!-- 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` --> ## Current Behavior <!-- This is the behavior we have today --> The `@nx/webpack/plugin` will resolve and read webpack options from user defined config files. However, it does not set the env vars indicating that a task is being run, because tasks are not being run at this stage. This means that certain config properties are not being set by `applyBaseConfig`. Users' webpack configs may rely on these properties being set so they can modify them. When not set, this throws, meaning the graph cannot be constructed. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Initialize the properties that we usually set when `applyBaseConfig` is used. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23296 (cherry picked from commit 3e84967)
…23296 (#23368) <!-- 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` --> ## Current Behavior <!-- This is the behavior we have today --> The `@nx/webpack/plugin` will resolve and read webpack options from user defined config files. However, it does not set the env vars indicating that a task is being run, because tasks are not being run at this stage. This means that certain config properties are not being set by `applyBaseConfig`. Users' webpack configs may rely on these properties being set so they can modify them. When not set, this throws, meaning the graph cannot be constructed. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Initialize the properties that we usually set when `applyBaseConfig` is used. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23296
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. |
Current Behavior
When running
pnpm nx report
in this project I get this error:Running
nx reset
does not fix this. Error occurred when recreating #23295Expected Behavior
pnpm nx report
should work.GitHub Repo
https://github.com/beeman/solana-dapp-react-version
Steps to Reproduce
git clone https://github.com/beeman/solana-dapp-react-version
cd solana-dapp-react-version
pnpm install
pnpm nx report
pnpm nx reset
Nx Report
Failure Logs
Package Manager Version
9.0.5
Operating System
Additional Information
I've been having similar issues for quite some time now, but could never reproduce it consistently. With this project it seems to happen consistently.
The text was updated successfully, but these errors were encountered: