-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Issue using @swc-node/register and @swc/core #22146
Comments
Experiencing exactly the same issue:
|
Same issue here after upgrading nx to 18+.
It's seems to appear only when running custom executors.
Also, this seems somewhat related to #21905 |
Maybe related to #21377 Nx schematics adds these two packages, and after install, build of angular is broken. |
I have some custome executors so that would make sense |
Upgrading NX to 18.1.2 fixed this issue for me. |
I just upgraded to 18.1.2 and continue to get the same issue :( |
I have managed to reproduce the issue with a brand new nx workspace. The repo can be found here When you have it all set up, running the following command will generate the error |
Confirmed, exactly what I did too. Followed the instructions and got the same error, although the executor does work. Using version 18.2.1: $ nx run test-plugin:echo --verbose Caused by: |
After spending a couple hours debugging the Simply install
I've tested it on Windows 11 and WSL via devcontainers and the problem seems to be fixed. Here is a link to a basic working repository using a local plugin & executor: Let me know if this helps. In case anyone is curious, here are some observations I made while debugging the
// node_modules/nx/src/tasks-runner/run-command.js - line 261
function loadTasksRunner(modulePath) {
try {
const maybeTasksRunner = require(modulePath);
// to support both babel and ts formats
return 'default' in maybeTasksRunner
? maybeTasksRunner.default
: maybeTasksRunner;
}
catch (e) {
if (e.code === 'MODULE_NOT_FOUND' &&
(modulePath === 'nx-cloud' || modulePath === '@nrwl/nx-cloud')) {
return require('../nx-cloud/nx-cloud-tasks-runner-shell')
.nxCloudTasksRunnerShell;
}
throw e;
}
} Hopefully, this helps. Let me know if I missed anything. Nx Report For Windows 11 & WSL Node : 20.11.1
OS : win32-x64
npm : 10.2.4
nx (global) : 18.2.1
nx : 18.2.1
@nx/js : 18.2.1
@nx/jest : 18.2.1
@nx/linter : 18.2.1
@nx/eslint : 18.2.1
@nx/workspace : 18.2.1
@nx/devkit : 18.2.1
@nx/eslint-plugin : 18.2.1
@nx/nest : 18.2.1
@nx/node : 18.2.1
@nx/plugin : 18.2.1
@nrwl/tao : 18.2.1
@nx/web : 18.2.1
@nx/webpack : 18.2.1
nx-cloud : 18.0.0
typescript : 5.4.3
---------------------------------------
Local workspace plugins:
@org/my-plugin
|
Can confirm this happened in a relatively new workspace, ~1 month or so, that has no Angular. Connected workspace to Nx Cloud thinking it was the cache, but that solely did not fix the issue. It was not until I |
We added nx-cloud as dependency without the issue being fixed. The error is still occuring since about 1 month. |
Current Behavior
To avoid getting wanings from nx whenever I run a build, I have installed
@swc/core
,@swc-node/register
and@swc/helpers
No however, whenever I run a build of one of my projects inside my nx monorepo, I get the following error
The code that this error is referring to is located in
.nx\cache\cloud\2402.27.3.hotfix2\index.js
While it says this is an error, the build appears to go through and complete successfully anyway
I have tried reinstalling my node_modules and removing the .nx folder but I get the same issue
I have tried creating a brand new nx monorepo with an empty app and this appears to build fine without this error.
Expected Behavior
The build should complete without any errors
GitHub Repo
https://github.com/kris-vista/nx-swc-issue
Steps to Reproduce
I am unable to reproduce this outside of my complex monorepo
Nx Report
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: