Skip to content
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

Problem with debug on nx.dev monorepo #37

Open
Areen3 opened this issue Feb 13, 2021 · 6 comments
Open

Problem with debug on nx.dev monorepo #37

Areen3 opened this issue Feb 13, 2021 · 6 comments

Comments

@Areen3
Copy link

Areen3 commented Feb 13, 2021

Hi
I have problem with debug usign pro version under monorepo nx.dev

Plugin works when I use angular app corectly.
When I use plugin uder nx i have error:

The function exported by the plugins file threw an error.

We invoked the function exported by `E:\apr\apps\af\example-e2e\src\plugins\index.js`, but it threw an error.

 Error: Please provide an absolute path to a tsconfig.json as cypressConfig.env.tsConfig
    at preprocessTypescript (E:\apr\packages\cypress\src\plugins\preprocessor.ts:11:11)

I think that problem is little explain in this issue:
nrwl/nx#1707

For me nx manage diffrent way configuration then You are use ?
Can You look on these problem ?
Thans...

@mbolotov
Copy link
Owner

Hi @Areen3!
It would be nice if you provided a reproducible repo for this problem?
Is that possible?

@Areen3
Copy link
Author

Areen3 commented Feb 14, 2021

Hi

here is repo: https://github.com/Areen3/debug-nx-cypress
branch: debug-plugin-intelijs-pro
in readme You have some basic command
I thing that are two problems:

  1. problem with localization cypress.json file
  2. problem with source files
    files with source *.ts doesn't exist
    image
    when I run app without nx workspace I have these *.ts files

In this example You have call library from area e2e - to test debug and importing *.ts

I hope that helps

@Areen3
Copy link
Author

Areen3 commented Feb 14, 2021

Hi
I added branch multi-project angular that works with many project https://angular.io/guide/file-structure#multiple-projects
You can test these example, it is simpler than with nx

@mbolotov
Copy link
Owner

I tried the multi-project-angular branch and found one problem with cypress only:
it has wrong paths in cypress.json file.
When I fixed this, it run okay:
image

Could you look at the branch and check if you still have the problem after fixing cypress.json?

@Areen3
Copy link
Author

Areen3 commented Feb 20, 2021

Yes you are right

I've come to this
there were generally three problems:
what i established is:
Multi project:

  1. when you run cypress from the command line, you need to enter the directory
    and cypress.json paths should be local, then your plugin will work
  2. when we run the tests with ng, the paths given in angular.json should be to another file, e.g. cypress.multi.json and then it is possible to follow
    NX:
  3. nx requires local paths in cypress.json so two modes work at once
  4. however, nx has a bug reported here:
    Problem with no source code generation for compiling with cypress nrwl/nx#4833
    the point is that loading the plugin causes a tracking error, but the problem is with nx @ cypress / webpack-preprocessor being used by the plugin
    if I announce the use of this plugin, then all tracking works as well

for now I can debug using your plugin and nx

maybe you have some clue why cypress do this: make absolute path in web pack
nrwl/nx#3424 (comment)
this is strange, I am afraid that these absolute path can make problems

thanks for help :)

@Areen3
Copy link
Author

Areen3 commented Feb 20, 2021

and here:
https://github.com/Areen3/debug-nx-cypress/tree/debug-plugin-vsc
You have nx working with plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants