Open mklueh opened 2 weeks ago
Without a repo this is going to be tough to debug.
The plugin config you have in your nx.json is going to find all nuxt config files and attempt to create targets for a project at that directory.
If you only use a project.json and not anything inferred by this plugin, you can remove it from your nx.json.
Otherwise, you can add exclude: ["path/to/project"]
to the plugin definition in nx.json
to avoid that directory when searching for config files.
It might help to understand how the project graph is created now.
nx.json
nx.json
, glob the workspace for the appropriate config filesYou can read more about Project Crystal here: https://nx.dev/concepts/inferred-tasks
Generally, everything here is working as expected, however, there could be an issue in the @nx/nuxt/plugin
where it is assuming something is defined in the nuxt config which is actually missing for your nuxt config file. But that's going to be hard to tell without a repo.
This might only be tangentially related, but for me the issue was an implicit import of defineNuxtConfig
in nuxt.config.ts
. The error nx printed was just undefined
but after changing the nuxt config to .js
the error included more details.
So adding import { defineNuxtConfig } from 'nuxt/config';
to nuxt.config.ts
solved the issue for me.
This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Current Behavior
First of all, please please please make the logs of this error more detailed! Me and others have wasted days with this issue, walking totally in the dark and the only way to find the cause is pure trial and error!
So recently I was facing this error again "Cannot read properties of undefined (reading 'split')"
and tried to exclude my projects one by one using .nxignore
After I figured out, that it is only one of the projects causing it, it made no sense to me, so I modified my nx.json until I found out that this plugin configuration is causing the trouble:
This is the project.json of the affected app:
As far as I'm aware of, I'm not even using anything of the plugin right now, so it doesn't make sense that this app especially is causing the problem. In fact, my other apps are very similar, except the playwright /lighthouse tasks.
Both the plugin config, and the project.json are identical to my production version, but other lines of my overall nx.json have changed.
Expected Behavior
GitHub Repo
No response
Steps to Reproduce
As far as I can tell, in my case the plugin config in my nx.json is enough to cause the issue with the one app, but I'm not sure this is reproducible, as the issue doesn't make sense in my opinion.
Nx Report
Node : 22.9.0 OS : win32-x64 Native Target : x86_64-windows yarn : 4.5.0
nx : 19.8.4 @nx/js : 19.8.4 @nx/jest : 19.8.4 @nx/linter : 19.8.4 @nx/eslint : 19.8.4 @nx/workspace : 19.8.4 @nx/devkit : 19.8.4 @nrwl/devkit : 19.6.0 @nx/esbuild : 19.8.4 @nx/eslint-plugin : 19.8.4 @nx/express : 19.8.4 @nx/node : 19.8.4 @nx/nuxt : 19.8.4 @nx/playwright : 19.8.4 @nrwl/tao : 15.9.7 @nx/vite : 19.8.4 @nx/vue : 19.8.4 @nx/web : 19.8.4 @nx/webpack : 19.8.4 typescript : 5.6.2
Registered Plugins: @nx/vite/plugin @nx/eslint/plugin @nx/playwright/plugin
Community plugins: @jnxplus/nx-gradle : 1.11.1 @nxlv/python : 19.1.3 @theunderscorer/nx-semantic-release : 2.12.0
The following packages should match the installed version of nx
To fix this, run
nx migrate nx@19.8.4
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response