-
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/nuxt/plugin config causing "Cannot read properties of undefined (reading 'split')" for one project not even using the plugin #28374
Comments
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. It might help to understand how the project graph is created now.
You 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 |
This might only be tangentially related, but for me the issue was an implicit import of So adding |
This issue has been automatically marked as stale because no reproduction was provided within 7 days. |
<!-- 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 --> We switched to using `loadConfigFile` from `@nx/devkit` to load Nuxt Config files when plugins were not isolated. However, they are now, so we can use `loadNuxtConfig` again. The effect of using `loadConfigFile` paired with Nuxt's auto-imports resulted in inconsistent failures. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Use `loadNuxtConfig` when `NX_ISOLATE_PLUGINS=true` ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #28506 Fixes #28374 (cherry picked from commit be7bfa4)
<!-- 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 --> We switched to using `loadConfigFile` from `@nx/devkit` to load Nuxt Config files when plugins were not isolated. However, they are now, so we can use `loadNuxtConfig` again. The effect of using `loadConfigFile` paired with Nuxt's auto-imports resulted in inconsistent failures. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Use `loadNuxtConfig` when `NX_ISOLATE_PLUGINS=true` ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #28506 Fixes #28374 (cherry picked from commit be7bfa4)
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
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
The text was updated successfully, but these errors were encountered: