Hello Guys, How are you all? Hope You all Are Fine. Today When I’m trying to use spreading in typescript But I get a warning with red marking from vs code the syntax requires an imported helper named __spreadArrays in Javascript. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How the syntax requires an imported helper named __spreadArrays Error Occurs ?
Today When I’m trying to use spreading in typescript But I get warning with red marking from vs code :
the syntax requires an imported helper named __spreadArrays
typescript version: "2.3.4"
target: "es5"
How To Solve the syntax requires an imported helper named __spreadArrays Error ?
How To Solve the syntax requires an imported helper named __spreadArrays Error?
To Solve the syntax requires an imported helper named __spreadArrays Error Update tsLib dependency to get rid of the highlighting. In my case it was version
1.9.0
. Update to1.10.0
solved the issue.the syntax requires an imported helper named __spreadArrays
To Solve the syntax requires an imported helper named __spreadArrays Error Update tsLib dependency to get rid of the highlighting. In my case it was version
1.9.0
. Update to1.10.0
solved the issue.
Solution 1
Update tsLib dependency to get rid of the highlighting. In my case it was version 1.9.0
. Update to 1.10.0
solved the issue.
__spreadArrays
is added in 1.10.0
tsLib
version:
Solution 2
Just run this command to solve this error. it updated to version 2.2.0
npm install tslib@latest --save
Solution 3
I Just change it to es6 to get it to work without adding a dependency.
Summery
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also Read