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

CT Stack Traces still broken in v10.10.0 on MacOS #24235

Closed
rmmanseau opened this issue Oct 12, 2022 · 3 comments
Closed

CT Stack Traces still broken in v10.10.0 on MacOS #24235

rmmanseau opened this issue Oct 12, 2022 · 3 comments
Assignees

Comments

@rmmanseau
Copy link

rmmanseau commented Oct 12, 2022

Current behavior

I am still seeing issue #21720 on MacOS. It was supposedly fixed for linux and windows in PR #23916 (no mention of macOS), which shows the failing assert in a box with a link to open the line in the IDE.

Heres an example of how it looks on my machine
image

Also, clicking on any of the Open in IDE buttons that do exist (like the one for the current spec file) do not work.

Desired behavior

It should show the line that failed, with an accurate stack trace, and clicking open in IDE should work. this image is pulled from the aforementioned pull request

image

Test code to reproduce

Run a cypress CT test on a macbook running macOS 12.6

Cypress Version

10.10.0

Node version

v14.20.0

Operating System

macOS 12.6

Debug Logs

This portion of the logs seems like it could be helpful

2022-10-12T21:29:18.269Z cypress-verbose:graphql:operation Creating context for app, operation SpecRunnerOpenMode_OpenFileInIDE
2022-10-12T21:29:18.270Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379121.573658, response: { opcode: 1, mask: true, payloadData: '42/data-context,9["graphql:request","gql10","{\\"query\\":\\"mutation SpecRunnerOpenMode_OpenFileInIDE($input: FileDetailsInput!) {\\\\n  openFileInIDE(input: $input)\\\\n}\\\\n\\",\\"operationName\\":\\"SpecRunnerOpenMode_OpenFileInIDE\\",\\"variables\\":{\\"input\\":{\\"line\\":166559,\\"column\\":17}}}"]' } } }
2022-10-12T21:29:18.271Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379121.575669, response: { opcode: 1, mask: false, payloadData: '43/data-context,9[{"errors":[{"message":"Variable \\"$input\\" got invalid value { line: 166559, column: 17 }; Field \\"filePath\\" of required type \\"String!\\" was not provided.","locations":[{"line":1,"column":43}]}]}]' } } }
2022-10-12T21:29:18.893Z cypress-verbose:graphql:operation Creating context for app, operation SpecRunnerOpenMode_OpenFileInIDE
2022-10-12T21:29:18.894Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379122.197765, response: { opcode: 1, mask: true, payloadData: '42/data-context,10["graphql:request","gql11","{\\"query\\":\\"mutation SpecRunnerOpenMode_OpenFileInIDE($input: FileDetailsInput!) {\\\\n  openFileInIDE(input: $input)\\\\n}\\\\n\\",\\"operationName\\":\\"SpecRunnerOpenMode_OpenFileInIDE\\",\\"variables\\":{\\"input\\":{\\"line\\":166559,\\"column\\":17}}}"]' } } }
2022-10-12T21:29:18.895Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379122.199762, response: { opcode: 1, mask: false, payloadData: '43/data-context,10[{"errors":[{"message":"Variable \\"$input\\" got invalid value { line: 166559, column: 17 }; Field \\"filePath\\" of required type \\"String!\\" was not provided.","locations":[{"line":1,"column":43}]}]}]' } } }
2022-10-12T21:29:19.429Z cypress-verbose:graphql:operation Creating context for app, operation SpecRunnerOpenMode_OpenFileInIDE
2022-10-12T21:29:19.429Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379122.733618, response: { opcode: 1, mask: true, payloadData: '42/data-context,11["graphql:request","gql12","{\\"query\\":\\"mutation SpecRunnerOpenMode_OpenFileInIDE($input: FileDetailsInput!) {\\\\n  openFileInIDE(input: $input)\\\\n}\\\\n\\",\\"operationName\\":\\"SpecRunnerOpenMode_OpenFileInIDE\\",\\"variables\\":{\\"input\\":{\\"line\\":166559,\\"column\\":17}}}"]' } } }
2022-10-12T21:29:19.430Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379122.734969, response: { opcode: 1, mask: false, payloadData: '43/data-context,11[{"errors":[{"message":"Variable \\"$input\\" got invalid value { line: 166559, column: 17 }; Field \\"filePath\\" of required type \\"String!\\" was not provided.","locations":[{"line":1,"column":43}]}]}]' } } }
2022-10-12T21:29:19.824Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379123.128371, response: { opcode: 1, mask: false, payloadData: '2' } } }
2022-10-12T21:29:19.824Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379123.128463, response: { opcode: 1, mask: true, payloadData: '3' } } }
2022-10-12T21:29:19.861Z cypress-verbose:graphql:operation Creating context for app, operation SpecRunnerOpenMode_OpenFileInIDE
2022-10-12T21:29:19.861Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379123.165609, response: { opcode: 1, mask: true, payloadData: '42/data-context,12["graphql:request","gql13","{\\"query\\":\\"mutation SpecRunnerOpenMode_OpenFileInIDE($input: FileDetailsInput!) {\\\\n  openFileInIDE(input: $input)\\\\n}\\\\n\\",\\"operationName\\":\\"SpecRunnerOpenMode_OpenFileInIDE\\",\\"variables\\":{\\"input\\":{\\"line\\":166559,\\"column\\":17}}}"]' } } }
2022-10-12T21:29:19.862Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379123.166827, response: { opcode: 1, mask: false, payloadData: '43/data-context,12[{"errors":[{"message":"Variable \\"$input\\" got invalid value { line: 166559, column: 17 }; Field \\"filePath\\" of required type \\"String!\\" was not provided.","locations":[{"line":1,"column":43}]}]}]' } } }
2022-10-12T21:29:20.342Z cypress-verbose:graphql:operation Creating context for app, operation SpecRunnerOpenMode_OpenFileInIDE
2022-10-12T21:29:20.343Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379123.646696, response: { opcode: 1, mask: true, payloadData: '42/data-context,13["graphql:request","gql14","{\\"query\\":\\"mutation SpecRunnerOpenMode_OpenFileInIDE($input: FileDetailsInput!) {\\\\n  openFileInIDE(input: $input)\\\\n}\\\\n\\",\\"operationName\\":\\"SpecRunnerOpenMode_OpenFileInIDE\\",\\"variables\\":{\\"input\\":{\\"line\\":166559,\\"column\\":17}}}"]' } } }
2022-10-12T21:29:20.344Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379123.648492, response: { opcode: 1, mask: false, payloadData: '43/data-context,13[{"errors":[{"message":"Variable \\"$input\\" got invalid value { line: 166559, column: 17 }; Field \\"filePath\\" of required type \\"String!\\" was not provided.","locations":[{"line":1,"column":43}]}]}]' } } }
2022-10-12T21:29:20.815Z cypress-verbose:graphql:operation Creating context for app, operation SpecRunnerOpenMode_OpenFileInIDE
2022-10-12T21:29:20.815Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379124.1196, response: { opcode: 1, mask: true, payloadData: '42/data-context,14["graphql:request","gql15","{\\"query\\":\\"mutation SpecRunnerOpenMode_OpenFileInIDE($input: FileDetailsInput!) {\\\\n  openFileInIDE(input: $input)\\\\n}\\\\n\\",\\"operationName\\":\\"SpecRunnerOpenMode_OpenFileInIDE\\",\\"variables\\":{\\"input\\":{\\"line\\":166559,\\"column\\":17}}}"]' } } }
2022-10-12T21:29:20.816Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379124.120785, response: { opcode: 1, mask: false, payloadData: '43/data-context,14[{"errors":[{"message":"Variable \\"$input\\" got invalid value { line: 166559, column: 17 }; Field \\"filePath\\" of required type \\"String!\\" was not provided.","locations":[{"line":1,"column":43}]}]}]' } } }
2022-10-12T21:29:21.256Z cypress-verbose:graphql:operation Creating context for app, operation SpecRunnerOpenMode_OpenFileInIDE
2022-10-12T21:29:21.257Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameSent', params: { requestId: '36751.9', timestamp: 379124.561218, response: { opcode: 1, mask: true, payloadData: '42/data-context,15["graphql:request","gql16","{\\"query\\":\\"mutation SpecRunnerOpenMode_OpenFileInIDE($input: FileDetailsInput!) {\\\\n  openFileInIDE(input: $input)\\\\n}\\\\n\\",\\"operationName\\":\\"SpecRunnerOpenMode_OpenFileInIDE\\",\\"variables\\":{\\"input\\":{\\"line\\":166559,\\"column\\":17}}}"]' } } }
2022-10-12T21:29:21.258Z cypress-verbose:server:browsers:cri-client:recv:[<--] received CDP message { method: 'Network.webSocketFrameReceived', params: { requestId: '36751.9', timestamp: 379124.562676, response: { opcode: 1, mask: false, payloadData: '43/data-context,15[{"errors":[{"message":"Variable \\"$input\\" got invalid value { line: 166559, column: 17 }; Field \\"filePath\\" of required type \\"String!\\" was not provided.","locations":[{"line":1,"column":43}]}]}]' } } }

Other

this is my cypress.config.js file, im not sure if its relevant. the app im testing uses craco, which doesn't appear to be supported yet (see #21952), but I found a workaround (see #22672 (comment)).

const { defineConfig } = require("cypress");
const { devServer } = require('@cypress/webpack-dev-server');
const { createWebpackDevConfig } = require("@craco/craco");

// Cypress 10 supports create-react-app but it doesn't support CRACO yet, see:
// https://github.com/cypress-io/cypress/issues/22672#issuecomment-1195455153
// Via trial & error i've found that component testing works if you remove
// the following plugins from the webpack config that CRACO generates.
// My understand is that the cypress-component runner disables support for these
// plugins and so trying to load them results in errors.
// This workaround should be removed in favor of the official craco support when
// the following issue is resolved
// https://github.com/cypress-io/cypress/issues/21952
const cracoConfig = require("./craco.config.js");
const webpackConfig = createWebpackDevConfig(cracoConfig);
const filteredPlugins = webpackConfig.plugins.filter(plugin => (
  !["HotModuleReplacementPlugin",
    "HtmlWebpackPlugin",
    "ReactRefreshPlugin",
   ].includes(plugin.constructor.name)
));
webpackConfig.plugins = filteredPlugins;

module.exports = defineConfig({
  trashAssetsBeforeRuns: false,
  defaultCommandTimeout: 4000,
  retries: {
    runMode: 2,
    openMode: 0,
  },

  e2e: {
    numTestsKeptInMemory: 0,
    viewportHeight: 900,
    viewportWidth: 1600,
    specPattern: "cypress/e2e/**/*.spec.js",
  },

  component: {
    devServer(devServerConfig) {
      return devServer({...devServerConfig, webpackConfig })
    },
    specPattern: "src/**/*.cy.js",
  },
});
@warrensplayer
Copy link
Contributor

@rmmanseau Thanks for reporting this.

I can reproduce the issue you are seeing with the "Open in IDE" button on the row with the "TEST BODY" header for a test. I get the same error for component tests. (E2E tests work fine)

As for not seeing the accurate stack trace, I cannot reproduce that issue unless I downgrade Cypress to before 10.10.0. Please confirm that you are using Cypress version 10.10.0. If you are, can you provide a simple project that reproduces the stack trace issue?

@rmmanseau
Copy link
Author

tried reproducing it in a simple repo & turned out I couldn't. after a while I went back to the original repo & did rm -r node_modules yarn.lock && yarn and after reinstalling everything it started working. I guess the update requires wiping the old node_modules.

false alarm!

@warrensplayer
Copy link
Contributor

@rmmanseau Thanks for the feedback on what worked for you. I saw your comment on #21684 regarding the "Open in IDE" button. I am going to look into the status of that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants