cypress-skip-and-only-ui icon indicating copy to clipboard operation
cypress-skip-and-only-ui copied to clipboard

Trouble using in typescript project

Open mjgoeke opened this issue 6 years ago • 0 comments

I'm having trouble getting this plugin pulled in in the support/index.js in my Cypress (with typescript) project.

When clicking to run a test, the test runner ui shows

Oops...we found an error preparing this test file:

./cypress/support/index.js
Module not found: Error: Can't resolve 'cypress-skip-and-only-ui/support' in 'c:\my-test-project\cypress\support'
resolve 'cypress-skip-and-only-ui/support' in 'c:\my-test-project\cypress\support'
  Parsed request is a module
  using description file: c:\my-test-project\package.json (relative path: ./cypress/support)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      c:\my-test-project\cypress\support\node_modules doesn't exist or is not a directory
      c:\my-test-project\cypress\node_modules doesn't exist or is not a directory
      c:\_dev\ElectricGridEcosystem\node_modules doesn't exist or is not a directory
      c:\_dev\node_modules doesn't exist or is not a directory
      c:\node_modules doesn't exist or is not a directory
      looking for modules in c:\my-test-project\node_modules
        using description file: c:\my-test-project\package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: c:\my-test-project\node_modules\cypress-skip-and-only-ui\package.json (relative path: ./support)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              c:\my-test-project\node_modules\cypress-skip-and-only-ui\support doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              c:\my-test-project\node_modules\cypress-skip-and-only-ui\support.ts doesn't exist
            as directory
              c:\my-test-project\node_modules\cypress-skip-and-only-ui\support doesn't exist
[c:\my-test-project\cypress\support\node_modules]
[c:\my-test-project\cypress\node_modules]
[c:\_dev\ElectricGridEcosystem\node_modules]
[c:\_dev\node_modules]
[c:\node_modules]
[c:\my-test-project\node_modules\cypress-skip-and-only-ui\support]
[c:\my-test-project\node_modules\cypress-skip-and-only-ui\support.ts]
 @ ./cypress/support/index.js 1:2-45
 @ multi ./cypress/support/index.js

I've run npm install -D cypress-skip-and-only-ui and all the files seem intact. I've tried deleting node_modules\cypress-skip-and-only-ui folder and re-running the npm install to no avail.

Here are my plugins and support index.js files: plugins_index.js.txt support_index.js.txt

Do you need to see webpack.config too?

What am I missing/doing wrong here?

mjgoeke avatar Sep 13 '19 19:09 mjgoeke