`error TS1192: Module '"@types/chai/index"' has no default export.`
I am using
```
"chai": "^5.1.1",
"chai-as-promised": "^8.0.0",
"chai-http": "^5.1.1",
```
and the following code snippet
```
import chai from 'chai'
import chaiHttp from 'chai-http'
import chaiAsPromised from "chai-as-promised";
//const chai = chaiModule.use(chaiHttp).use(chaiAsPromised)
chai.use(chaiAsPromised);
chai.use(chaiHttp)
chai.request.execute(app)
.post('/api/addstudents')
.send(data)
.end((err, res) => {
<snip>
```
throws the following errors:
```
Exception during run: tests/IntegrationTests/add_students_to_teacher_tests.ts(4,8): error TS1192: Module '"/usr/src/Node.JSRestAPI/node_modules/@types/chai/index"' has no default export.
tests/IntegrationTests/add_students_to_teacher_tests.ts(65,19): error TS7006: Parameter 'err' implicitly has an 'any' type.
tests/IntegrationTests/add_students_to_teacher_tests.ts(65,24): error TS7006: Parameter 'res' implicitly has an 'any' type.
tests/IntegrationTests/add_students_to_teacher_tests.ts(107,19): error TS7006: Parameter 'err' implicitly has an 'any' type.
tests/IntegrationTests/add_students_to_teacher_tests.ts(107,24): error TS7006: Parameter 'res' implicitly has an 'any' type.
```
关闭于 2024-10-19 1 条评论