mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

Problem with debug on nx.dev monorepo #37

Open Areen3 opened 3 years ago

Areen3 commented 3 years ago

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: https://github.com/nrwl/nx/issues/1707

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

mbolotov commented 3 years ago

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

Areen3 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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: 1) nx requires local paths in cypress.json so two modes work at once 2) however, nx has a bug reported here: https://github.com/nrwl/nx/issues/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 https://github.com/nrwl/nx/issues/3424#issuecomment-781631114 this is strange, I am afraid that these absolute path can make problems

thanks for help :)

Areen3 commented 3 years ago

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