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

Error: Cannot resolve cypress-xray-plugin/register #133

Closed
csvtuda opened this issue Jul 31, 2023 · 6 comments
Closed

Error: Cannot resolve cypress-xray-plugin/register #133

csvtuda opened this issue Jul 31, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@csvtuda
Copy link
Contributor

csvtuda commented Jul 31, 2023

Registering the plugin's app event listeners currently does not seem to work.

  Running:  language.feature                                                                (1 of 1)
X [ERROR] Could not resolve "cypress-xray-plugin/register"

    cypress/support/e2e.ts:20:7:
      20 │ import 'cypress-xray-plugin/register';
         ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The path "./register" is not exported by package "cypress-xray-plugin":

    node_modules/cypress-xray-plugin/package.json:30:15:
      30 │     "exports": "./index.js",
         ╵                ~~~~~~~~~~~~

  You can mark the path "cypress-xray-plugin/register" as external to exclude it from the bundle, which will remove this error.


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

  > cypress\support\e2e.ts

The error was:

Error: Build failed with 1 error:
cypress/support/e2e.ts:20:7: ERROR: Could not resolve "cypress-xray-plugin/register"
    at failureErrorWithLog (C:\Projects\frontend\node_modules\esbuild\lib\main.js:1636:15)
    at C:\Projects\frontend\node_modules\esbuild\lib\main.js:1048:25
    at runOnEndCallbacks (C:\Projects\frontend\node_modules\esbuild\lib\main.js:1471:45)
    at buildResponseToResult (C:\Projects\frontend\node_modules\esbuild\lib\main.js:1046:7)
    at C:\Projects\frontend\node_modules\esbuild\lib\main.js:1075:16
    at responseCallbacks.<computed> (C:\Projects\frontend\node_modules\esbuild\lib\main.js:697:9)
    at handleIncomingPacket (C:\Projects\frontend\node_modules\esbuild\lib\main.js:752:9)
    at Socket.readFromStdout (C:\Projects\frontend\node_modules\esbuild\lib\main.js:673:7)
    at Socket.emit (node:events:511:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:332:12)
    at readableAddChunk (node:internal/streams/readable:305:9)

TypeError: Cannot read properties of null (reading 'some')
    at afterSpecHandler (C:\Projects\frontend\node_modules\@badeball\cypress-cucumber-preprocessor\lib\add-cucumber-preprocessor-plugin.js:166:47)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.handler (C:\Projects\frontend\node_modules\cypress-on-fix\index.js:32:20)

Originally posted by @alexviz7 in #132 (comment)

@csvtuda csvtuda self-assigned this Jul 31, 2023
@csvtuda csvtuda added bug Something isn't working under investigation The issue is being investigated labels Jul 31, 2023
@csvtuda csvtuda added 🏗 in progress The issue is being worked on awaiting feedback The issue has been addressed and the reporter's feedback is requested and removed under investigation The issue is being investigated 🏗 in progress The issue is being worked on labels Jul 31, 2023
@csvtuda
Copy link
Contributor Author

csvtuda commented Jul 31, 2023

@alexviz7 This issue should be fixed in 4.0.1, feel free to try it out.

@alexviz7
Copy link

alexviz7 commented Aug 1, 2023

Ok it works with /register too now and no error shown.

@csvtuda csvtuda closed this as completed Aug 1, 2023
@csvtuda csvtuda removed the awaiting feedback The issue has been addressed and the reporter's feedback is requested label Aug 1, 2023
@caique-rd
Copy link

@csvtuda I'm getting this problem in 4.0.1 version, what should I do?

@caique-rd
Copy link

Works in 3.3.3

@caique-rd
Copy link

Using import "cypress-xray-plugin/plugin"; in e2e.js with 4.0.1 version works, should I use this way?

@csvtuda
Copy link
Contributor Author

csvtuda commented Aug 2, 2023

@caique-raidiam just remove the import in e2e.js altogether. It does not do anything and I am not planning on using the app events I could define in there.

@csvtuda csvtuda changed the title Could not resolve cypress-xray-plugin/register Error: Could not resolve cypress-xray-plugin/register Nov 25, 2023
@csvtuda csvtuda changed the title Error: Could not resolve cypress-xray-plugin/register Error: Cannot resolve cypress-xray-plugin/register Nov 25, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants