Closed christiango closed 1 year ago
Thanks for a quick fix! I did a one time sponsor for your time on this.
Thank you so much!
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
We started playing with swc minify for webpack and noticed one of our chunks produced invalid output that the browser failed to parse. I spent some time to get a minimal repro of the issue here.
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.27&code=H4sIAAAAAAAAA12Ry27DIBBF95b8D3dJNpbsrZVu%2BiUIT2IkFyIYt6ki%2Fr1gHo66wWKYOedi1Ca9x2daR7xC3%2FXdbTeKtTXQ%2FqhPwtiFLnj1HeCId2eQKtDGszSK7C0DprnvDkLGDXUe14aKHfR8WMdQp3gCPZnMcuZIJmUj3u2KrRNFDvj9QXE75x2v2g9fxKtdxiiR%2FtcoxObrR%2B0HNmJ8SzfOtXBwUS%2BZ5spEmFP23JQmEvFHai4hi2hqdpTjhhKXegAMvJIR%2F7JUvd1o2OxdJMtJA8I7QElWa5OF4xtywvjbWaty3xbreL7wB8xZVRDRAQAA&config=H4sIAAAAAAAAA22TQZLjIAxF7%2BJ1Fl29mEUfYHZ9BkoB4ZDByIVEOq5U7t7CsXGczM56%2FhLiS9y6M9vu69aNkBlz%2FeIpCVy7rw7tAGxzGKU7qEyRh8h4P3QCuUepEv78%2BPzQ35GIcREcuiGk4KdazNIwZmSu35pUBkzCTQc504%2BGkotGR6KIkN5iA2xCEuwxb6mWYoSR0Vwgt4x6GuTAlHaoCDozZhqfaHJBAiUttjKH4Iwlhw2EjFbCBTeJ1lBJYm2sdTJDh8fS99XAhxIvEAtIq4XX2QY9seWdKLAYXxK%2FoF2nD%2FS45KIK3mSUktOqOVNIOx%2F%2BIWqfEZgTDLhlztzrHPZK%2Fx9VSF6HKFOjOuGtq4S9Xs6E4NsNa9eYJWxuZXTFYr2h3YovcHchDg4Neq9ut2T%2BCWJPWzGZRiTfQnUN%2FDaDR2jWfdrTugJv8K92Jc%2FjWPgAcnplPA1Him8lBpQTuTesRgi9wqzbex1faUkO1WZ0Tz8K17CtqQ5fyMT62lafdSE0x%2FSRjm199VEOkPq2lvcKyJUKbrN582v9092317muE38vwrnQL9TiLpcSBAAA
Expected behavior
The code generated is equivalent and parses correctly in the browser
Actual behavior
The generated code is below
There is an await inside the console.log that is not inside an async function inside the then block.
Version
1.3.27
Additional context
No response