Couldn't find tsconfig.json. tsconfig-paths will b...
# i-need-help
d
Hey, I amtrying to implement cypress e2e testing in my angular project but while trying i have a problem with getting it started, i keep getting errors but i do not understand. I am new at cypress testing Couldn't find tsconfig.json. tsconfig-paths will be skipped
Copy code
ts
//tsconfig.json from screen
{
  "compilerOptions": {
    "module": "system",
    "noImplicitAny": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "outFile": "../../built/local/tsc.js",
    "sourceMap": true
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "**/*.spec.ts"]
}

https://cdn.discordapp.com/attachments/1108408611404775545/1108408611631276032/image.png

https://cdn.discordapp.com/attachments/1108408611404775545/1108408611937472542/image.png

f
@delightful-magician-24840 Diegow are you trying to import env variable in the first screenshot ? You can do that in the cypress config file using cypress.env. If so i can send you an example. About the ts config it should be one global file ^^' It searches for it in the root therefore wont find it. Also do you want to use ts for your cypress project ?
d
yes pls
i am very new at cypress so i dont rlly know how all of this works, i found this config file online and added it to cypress root
f
@delightful-magician-24840 Sure so you can remove it if you dont want to use it 😄 Honestly for basic tests no ts is needed ^^ For the environment variable : https://docs.cypress.io/guides/guides/environment-variables Check option #1 the env : {} object contains your variables. In the online example there are two variables specified. If you want to read them from your .env file you can just do that by specifiying a new variable:
Copy code
YOUR_VARIABLE_NAME : process.env.YOUR_VARIABLE_NAME_IN_ENV_FILE!,```you might need to add dotenv dependency 🙂 To get the value inside the test is also shown just write in the testfile: ```Cypress.env('YOUR_VARIABLE_NAME')
d
i do not understand
i need to remove the config file?
the first screenshot is like the error i got
it is the index from node modules cypress C:\Users\diego\codex-platform\codex\codex-platform\node_modules\ci-info\index.js
this is like the error i was talking about in this screen

https://cdn.discordapp.com/attachments/1108408611404775545/1108421816394989659/image.png

f
Okay so first step remove the config file its not necessary u only have js spec files and the place is wrong so its doing more harm. The error in the first screenshot is not from cypress as it is stated. It is probably an unhandled error in console cypress will detect that and stop execution ^^' If you want i can help you set up the project in like an hour after work normally it shouldnt take more than 5 mins if you follow the step by step guide 😄
d
yes pls i remove the config file right now then
2 Views