You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kostia1st
changed the title
Object deconstruction with alias and default value does not work
TypeScript: Object deconstruction with alias and default value does not work
Nov 1, 2021
From my perspective this issue is critical - because it does not yell to the developer that something's not working, instead it silently works improperly.
If I had my billing implemented in TS/node.js, and poor E2E-testing applied, I'd be having 3 weeks of corrupt data by now. Cannot imagine someone's using version 12 of next.js in production right now.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 27, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugIssue was opened via the bug report template.SWCRelated to minification/transpilation in Next.js.
What version of Next.js are you using?
12.0.2
What version of Node.js are you using?
16.4.0
What browser are you using?
Edge, Chrome
What operating system are you using?
Windows 11
How are you deploying your application?
next dev
Describe the Bug
Here's a TypeScript code snippet
Output is
[]
Must be
[1, 2]
Once you remove the "default value" or aliasing - it works normally.
tsconfig.json
->compilerOptions
->"target": "es5", "module": "commonjs", "lib": ["dom", "dom.iterable", "esnext"]
Reverting back to
"next": "11.1.2"
immediately fixes the issue.Expected Behavior
Should be deconstructing objects properly, assigning the default value only when the provided one is not defined.
I can just imagine it's somehow connected with the new Rust compiler.
To Reproduce
See above
The text was updated successfully, but these errors were encountered: