Reputation: 8291
I know this error has been discussed in several posts but I could not avoid this error after following all the solutions.
I am developing a react application in VS 2017.
The following code causes me the error. Below I also shared the tsconfig file, which includes "lib":["es2015"]
. Any ideas how to solve this?
const fetchData = async () => {//Promise<void> =>
var dd = await axios.get('api/FeedbackComment/FetchFeedbackActivityByDate',
{
params: {
//activityDate: d3.timeParse("%Y-%m-%d")(d.dateCreated),
reviewRoundId: props.reviewRoundId,
submissionId: props.submissionId,
}
})
}
Below is my tsconfig.js
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": false,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
"target": "es6",
"allowJs": true,
"checkJs": false,
"jsx": "preserve",
"lib": [
"es2015"
//"es6",
//"dom"
],
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"resolveJsonModule": true,
"noEmit": true
},
"exclude": [
"node_modules",
//"wwwroot"
],
"include": [
"src/**/*",
"**/*.spec.ts"
//"src",
//"./src/myIndex.d.ts"
]
}
Upvotes: 3
Views: 478
Reputation: 2684
I eliminated this error by changing my ECMAScript version to 6.0
Upvotes: 2