Qytera-Gmbh / cypress-xray-plugin

A plugin for uploading Cypress test results to Xray.
https://qytera-gmbh.github.io
MIT License
21 stars 7 forks source link

Error: `Package path ./register is not exported from package /node_modules/cypress-xray-plugin` #343

Closed caique-rd closed 3 weeks ago

caique-rd commented 3 weeks ago

Description

Hey @csvtuda how are you? Could you help me with a problem in the latest version of cypress-xray-plugin, please? I was using the v6 version and everything was working, but after I update to 7.0.1 when I try to run cypress in run mode with cypress-xray-plugin I get the following error:

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

  > cypress/support/e2e.js

The error was:

Error: Webpack Compilation Error
Module not found: Error: Package path ./register is not exported from package /node_modules/cypress-xray-plugin (see exports field in /node_modules/cypress-xray-plugin/package.json)

Cypress version

13.12.0

Plugin version

7.0.1

Jira/Xray type

Cloud

Configuration

No response

Acknowledgements

csvtuda commented 3 weeks ago

Hi @caique-rd,

thanks for the question! The /register import does not exist anymore in version 7. It has been replaced with:

// cypress/support/e2e.js
import "cypress-xray-plugin/commands";

// ...

or

// cypress/support/e2e.js
import "cypress-xray-plugin/commands/tasks";

// ...

See here for more information.


But: Up until version 7, these imports did not do anything, the imported module was completely empty.

From version 7, these imports will allow you to upload cy.request data as Xray execution evidence if you wish. If you don't need this, you can simply remove the import line altogether.

caique-rd commented 3 weeks ago

Thank you so much, was exactly this, I forgot to remove the register import, but now it's working as expected.

csvtuda commented 3 weeks ago

To be fair, this change was not documented in the changelog. I must have missed it and will patch it.