Closed snake-py closed 2 years ago
The configuration is also crashing with the same error if I am trying to use any spread operator in this file.
Also once the UI crashed, I cannot return to end-to-end testing.
Hi! I think this might be fixed by https://github.com/cypress-io/cypress/pull/23637 (which isn't released; next week).
In the meantime, can you try using Node.js 16.16? Having your tsconfig.json
and package.json
would also be useful - what version of typescript, vue-cli, and wepback are you on?
If you've still got an error, please provide a minimal reproduction - I can definitely make more suggestions, but it's likely faster and easier if you create a minimal example I can run locally.
@lmiller1990 I will give feedback this week if I still see this issue
No problem, if you do make a minimal example please share it, I can test it out with the unreleased commits.
@lmiller1990 so I updated and still seeing the error, now I cannot even use end to end testing.
Node version 16.17.0
import { defineConfig } from 'cypress';
const getFromEnv = (defaultEnv) => {
const envPrefix = ['VUE_APP', 'PERCY'];
const customEnvKeys = Object.keys(process.env).filter((key) =>
envPrefix.some((prefix) => key.startsWith(prefix))
);
const mergedEnv = defaultEnv;
customEnvKeys.forEach((key) => {
mergedEnv[key] = process.env[key];
});
return mergedEnv;
};
const customConfigEnvs = getFromEnv({
CY_BASE_URL: 'http://localhost:8080',
CY_TIMEOUT: 60000,
CY_WAIT_SHORT: 4000,
CY_WAIT_MEDIUM: 6000,
CY_WAIT_LONG: 9000,
CY_LOGIN_USERNAME_OTP: 'info@XXX.de',
CY_LOGIN_USERNAME: 'XXX',
CY_LOGIN_PASSWORD: 'XXXX!',
CY_ACCESS_OTP_TOKEN: 'XXXXX',
});
export default defineConfig({
projectId: '',
experimentalSourceRewriting: false,
video: false,
chromeWebSecurity: false,
retries: {
runMode: 3,
openMode: 0,
},
env: customConfigEnvs,
fixturesFolder: 'tests/e2e/fixtures',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
component: {
supportFile: false,
devServer: {
framework: 'vue-cli',
bundler: 'webpack',
},
},
e2e: {
setupNodeEvents(on, config) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('cypress-terminal-report/src/installLogsPrinter')(on);
},
specPattern: 'tests/e2e/specs/**/*.{js,jsx,ts,tsx}',
supportFile: 'tests/e2e/support/index.js',
},
});
@snake-py I tried to reproduce the problem with your given config and I didn't see any issues. Before I investigate this further, please provide a reproducible example, preferably using the https://github.com/cypress-io/cypress-test-tiny template.
Right now there doesn't seem to be enough information to reproduce the problem on our end. We'll have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.
Please comment on this issue with a reproducible example and we can reopen. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.
@ZachJW34 So I had finally time to put something together where I am already seeing the issue: https://github.com/snake-py/minimal-bug-repo-cy-10
I added a Readme on how to use it. The repo has no tests and no app, only the barebone configs.
@snake-py Thank you for putting something together. I can confirm that I can reproduce this problem on my end.
Upon further investigation, the problem stems from tslib
setup in the tsconfig.json
file specifically declaring a particular path ("tslib": ["node_modules/tslib/tslib.d.ts"]
) for tslib
as you have done in your config file.
A simple workaround would be to remove this tslib
path all together from your tsconfig.json
. According to the tslib documentation you do not need to specify a path in your case but instead just set the importHelpers
flag which you have already done. Furthermore, if you update your path to "tslib": "[node_modules/tslib/]"
, this does the trick as well.
I am looking at how this might relate to the way Cypress handles typescript configurations but I hope that this work around suffices for now
@amehta265 thank you for pointing out the workaround. This seems sufficient enough for me.
Current behavior
I updated to cypress 10 today, and I am seeing below error message after cypress UI has offered me to automatically migrate my cypress.json to cypress.config.js/ts. The UI created the TS file successfully, but then I tried to set up component testing and the UI displays the error.
This is the created config file:
Debug logs