infosum / cypress-tags

Use custom tags to slice up Cypress test runs
83 stars 20 forks source link

1.1.1 Broken - Cannot find module #225

Closed zaq42 closed 1 year ago

zaq42 commented 1 year ago

Running Cypress gives the following error after upgrading to cypress-tags:1.1.1.

Reverting to 1.1.0 works as expected.

% yarn install   
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 263ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ cypress-tags@npm:1.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0019: │ cypress-tags-npm-1.1.0-e0c1a52a34-c2f5174f17.zip appears to be unused - removing
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: Done in 0s 617ms

% yarn test
Couldn't find tsconfig.json. tsconfig-paths will be skipped
Your configFile threw an error from: /.../cypress.config.ts

The error was thrown while executing your e2e.setupNodeEvents() function:

Error: Cannot find module '/.../node_modules/cypress-tags/dist/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:364:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:577:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/.../Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
...
gavinhenderson commented 1 year ago

Having the same issue 👍

annaet commented 1 year ago

I've been able to replicate this, will look into a fix

annaet commented 1 year ago

Hi @zaq42 / @gavinhenderson

I've just published 1.1.2 which should resolve this issue.

zaq42 commented 1 year ago

Thanks @annaet

Confirming that 1.1.2 works as expected for me.