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
Apps TS config not respected when running E2E suite #6917
Comments
Okey, a bit more context while I'm trying to decipher what is going wrong here. So I took a look into the nx source and eventually ended up in More specifically the difference is in the - "baseUrl": "src",
+ "baseUrl": "../..",
- "absoluteBaseUrl": "{project_root}/apps/admin/src"
+ - "absoluteBaseUrl": "{project_root}" (the additions (green lines) are from running the E2E executor, the removals from the functioning dev server executor) |
After digging into the As far as I can tell the env variable |
@FrozenPandaz sorry to bring you into this, but just wondering if you know the reasoning behind adding the |
For anyone encountering this same issue I managed to fix an interim solution by modifying the nx source code and using
You should get a patch similar to this: diff --git a/node_modules/@nrwl/cypress/src/executors/cypress/cypress.impl.js b/node_modules/@nrwl/cypress/src/executors/cypress/cypress.impl.js
index e03a1d0..9e7656b 100644
--- a/node_modules/@nrwl/cypress/src/executors/cypress/cypress.impl.js
+++ b/node_modules/@nrwl/cypress/src/executors/cypress/cypress.impl.js
@@ -43,7 +43,7 @@ function normalizeOptions(options, context) {
if (options.tsConfig) {
const tsConfigPath = path_1.join(context.root, options.tsConfig);
options.env.tsConfig = tsConfigPath;
- process.env.TS_NODE_PROJECT = tsConfigPath;
+ // process.env.TS_NODE_PROJECT = tsConfigPath;
}
checkSupportedBrowser(options);
return options; |
@leosvelperez @FrozenPandaz issue is still present in 12.10. Any idea when this will be fixed? This is a breaking change that's preventing us to update to a newer version of Nx |
Issue is still present in 13.1.3 version of @nrwl/cypress. Doing the patch work @adambrgmn suggested makes our tests work again. |
I think this issue is related, with the linked comment as a potential workaround #1276 (comment) Edit: |
Wow .. debugging all morning and @adambrgmn fix made my tests work again.. but would be nice with a better fix than patching ;) EDIT - instead of touching node_modules-files; i could also copy my nx tsconfig.base.json compilerOptions.paths to e2e's tsconfig.e2e.json and be able to run cypress tests right now. |
…nfig specification Closes nrwl#6917
Hey, I'm putting a PR in to fix our generator but this seems to be caused by the tsconfig option being passed in the cypress configuration. For example, in the reproduction from @adambrgmn "e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/admin-e2e/cypress.json",
"devServerTarget": "admin:serve",
- "tsConfig": "apps/admin-e2e/tsconfig.json"
},
"configurations": {
"production": {
"devServerTarget": "admin:serve:production"
}
}
}, This should work out of the box, as long as your e2e projects tsconfig is named |
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. |
First off all – thanks for this great project! It's making our lives so much easier 🙏 But... We've encountered an issue when trying to upgrade all our NX dependencies to version
12.8.0
. It's an inconsistency between running the development server directly and running it via the@nrwl/cypress
executor.Current Behavior
I have been able to reproduce the issue in this repo:
adambrgmn/nx-error-repro
.We are using the
baseUrl
option in one of our appstsconfig
("baseUrl": "src"
) and it has been working fine the whole time that we've used NX. And when upgrading fromv12.5
tov12.8
of all the NX packages it still works fine when runningnx run admin:serve
andnx run admin:build
. But when runningnx run admin-e2e:e2e
it fails hard:It's like when running the dev server via the E2E executor it ignores the
baseUrl
configured in our application. It's actually like it ignores thetsconfig
in that app completely. Because I've tried to move away from thebaseUrl
and use a path alias instead. But it is completely ignored.Expected Behavior
I expect the E2E executor to respect the
tsconfig
living in the application that it is targeting.And yes, this seems to be a regression, since this worked fine before trying to upgrade to v12.8.0.
Steps to Reproduce
I have been able to reproduce the whole thing in this repo:
adambrgmn/nx-error-repro
yarn
)yarn nx run admin:serve
and it should run without issuesyarn nx run admin:build
and it should run without issuesyarn nx run admin-e2e:e2e
and it should fail, complaining thatutils/add
can't be resolvedFailure Logs
Environment
The text was updated successfully, but these errors were encountered: