-
Notifications
You must be signed in to change notification settings - Fork 507
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
Spread syntax can't work with iterables (Set, Map) -- downlevelIteration issue #376
Comments
would love help finding root cause. bet we have a bad transform in here. |
@maroon1 @sw-yx this is typescript issue |
with option const set = new Set([1, 2, 3])
console.log([...set, 4, 5])
// [ Set { 1, 2, 3 }, 4, 5 ] meanwhile pure
...so need to check rollup/babel configs/presets |
related: "plugins": [
["@babel/plugin-transform-spread", {
"loose": true
}]
] loose defaults to false. In loose mode true, all iterables are assumed to be arrays. |
ok. got a recommendation? should we add that flag? |
@sw-yx not sure yet.. still playing with babel options & configs |
another solution:
const spread = [...
/*#__PURE__*/
new Set([1, 2, 3]), 4, 5];
console.log(spread); |
@ambroseus thx. |
Current Behavior
Expected behavior
Suggested solution(s)
Additional context
Your environment
The text was updated successfully, but these errors were encountered: