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 on chai types #19415
Comments
fasatrix
changed the title
Hi,
Hi, I am trying to replicate the work configuration (Windows 8) on my home computer (Wondows 10) and I get the following error from the compiler:
Aug 29, 2017
fasatrix
changed the title
Hi, I am trying to replicate the work configuration (Windows 8) on my home computer (Wondows 10) and I get the following error from the compiler:
Error on chai types
Aug 29, 2017
found the solutions thanks anyway.. can be closed |
could you please tell me the fix for this error? |
If anyone has this problem, double-check if you're not importing |
To anyone else having the same issue: I found the resolution here: #19480 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I am resonably new to typescript and mocha/chai in general. I am trying to replicate my work configuration (Windows 8) on my home computer (Windows 10) and I get the following error from the compiler (at work all works fine):
C:\dev\bookapi\mocha-api-test>tsc
node_modules/@types/chai/index.d.ts(1244,15): error TS2451: Cannot redeclare block-scoped variable 'chai'.
test/get-books-200ok.test.ts(24,5): error TS2451: Cannot redeclare block-scoped variable 'chai'.
This is my package.json:
{
"name": "mocha-api-test",
"version": "1.0.0",
"private": true,
"description": "BookAPI",
"scripts": {
"test": "mocha --reporter mocha-junit-reporter -r ts-node/register test/**/*.test.ts"
},
"license": "ISC",
"dependencies": {
"@types/chai": "^3.4.35",
"@types/chai-http": "0.0.30",
"@types/chai-json-schema": "^1.4.2",
"@types/mocha": "^2.2.39",
"@types/node": "^7.0.5",
"chai": "^3.5.0",
"chai-http": "^3.0.0",
"chai-json-schema": "^1.4.0",
"mocha": "^3.2.0",
"mocha-junit-reporter": "^1.13.0",
"ts-node": "^3.1.0",
"typescript": "^2.4.1"
}
}
and this is the tsconfig.ts:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"sourceMap": false,
"outDir": "./build",
"typeRoots": [
"node_modules/@types"
],
"types": [
"mocha",
"node",
"chai",
"chai-http",
"chai-json-schema"
]
},
"exclude": [
"node_modules",
"build"
]
}
Thanks for any help
The text was updated successfully, but these errors were encountered: