Comments (5)
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.
from nx.
Let me take a closer look at what is causing the plugin graph to fail during creation and I'll update here again
from nx.
Hey @beeman !
So it's a true error, it's just a little bit hidden unfortunately.
The error comes from the web/webpack.config.js
file.
It's trying to set fallback
on config.resolve
when resolve
is undefined
console.log("config.resolve", config.resolve);
config.resolve.fallback = {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
};
output:
config.resolve undefined
Changing that section to:
config.resolve ??= {};
config.resolve.fallback = {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
};
Allows it to work:
NX Report complete - copy this into the issue template
Node : 20.12.2
OS : darwin-arm64
pnpm : 8.15.7
nx : 19.0.0
@nx/js : 19.0.0
@nx/jest : 19.0.0
@nx/linter : 19.0.0
@nx/eslint : 19.0.0
@nx/workspace : 19.0.0
@nx/devkit : 19.0.0
@nx/eslint-plugin : 19.0.0
@nx/react : 19.0.0
@nx/rollup : 19.0.0
@nrwl/tao : 19.0.0
@nx/web : 19.0.0
@nx/webpack : 19.0.0
typescript : 5.4.5
---------------------------------------
Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
---------------------------------------
Community plugins:
@solana-developers/preset-react : 3.0.0-beta.4
To uncover errors like these, you can run NX_DAEMON=false pnpm nx graph
Or you can check in the .nx/cache/d/daemon.log
from nx.
Hey @beeman !
So it's a true error, it's just a little bit hidden unfortunately.
The error comes from the
web/webpack.config.js
file.It's trying to set
fallback
onconfig.resolve
whenresolve
is undefinedconsole.log("config.resolve", config.resolve); config.resolve.fallback = { crypto: require.resolve('crypto-browserify'), stream: require.resolve('stream-browserify'), };output:
config.resolve undefined
Changing that section to:
config.resolve ??= {}; config.resolve.fallback = { crypto: require.resolve('crypto-browserify'), stream: require.resolve('stream-browserify'), };
Thanks for checking this @Coly010 .
I don't think this should be closed, as it's a regression.
The same webpack.config.js
worked fine in previous versions. For example in this repo there is the exact same file, and pnpm nx report
works as expected.
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.
To uncover errors like these, you can run
NX_DAEMON=false pnpm nx graph
Or you can check in the.nx/cache/d/daemon.log
This is very useful, thanks. I've been getting these errors all the time lately and never knew how to debug it!
from nx.
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 nx reset
and then nx report
, you'll see it also fails.
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 withNx
. Perhaps we can initialize some more with empty objects.
from nx.
Related Issues (20)
- TypeError in nx:run-commands with `env` option HOT 1
- `Failed to process project graph` with multiple apps starting in parrallel HOT 1
- eslint-plugin-vitest causing circular dependency issues HOT 3
- runExecutor does not run buildTarget using @nx/js:node executor HOT 3
- `nx run api:serve` not working on project folder HOT 1
- .env.local environment variables are not being picked up after upgrading from NX v18 to v19 HOT 4
- @nx/node:setup-docker generator produces invalid Dockerfile HOT 1
- ' @nrwl/nx' declared in 'libs\ruclib\.eslintrc.json ยป ../../.eslintrc.json#overrides[1]': Cannot find module 'nx/src/plugins/js/project-graph/build-dependencies/target-project-locator '" HOT 1
- angular and nestjs shared library esbuild vs nestjs build settings
- Non JS projects not affected if language specific dependency changes
- Cannot read properties of undefined (reading 'paths') when the base config doesn't include that option
- Vite configurations are missing build.emptyOutDir property resulting in output directory not being cleaned, and warning
- TS Path alias imports not working for spec.ts (the work for .spec.tsx) when using a next project HOT 1
- NX nrwl 19 seems to be causing issues with other packages, e.g. GrommetJS HOT 1
- NX Cannot find configuration for task web:serve in Docker container HOT 1
- NX 19: NX Cannot read properties of undefined (reading 'split')
- LoadPluginError: Could not load plugin HOT 1
- Projects without a package.json get excluded from "__default__" release group
- Prerelease version calculation doesn't consider commits
- TS type check is checking my lib incorrectly when added it to an App project.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx.