-
Notifications
You must be signed in to change notification settings - Fork 361
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
[Bug] Wrong function scope with rest parameters after transpiled #1037
Comments
Looks to be the same issue as #1001 |
@rschristian Is there a plan to fix this issue? Currently I'm using the following workaround to avoid it:
|
Not that I know of. I might be able to take a look later this week, but no guarantees. |
I'm running into a same-ish bug — async/await is transpiled out of my CommonJS builds, and (for whatever reason) the transpiled code is incorrect. I don't really want async/await transpiled at all though. Is there a "browserslist": [
"node >= 20"
], The 'modern' build works fine, but I'm trying to keep CJS support a while longer at least. Glad to file a new bug with more details if this is unexpected. |
If you're targetting Node (as your browserslist config example seems to indicate), you should be specifying the target. Microbundle targets the web by default. Add |
Sorry, I'm not actually targeting Node – just an example. I am targeting Node+Web+Deno. I've tried A 'modern' option for CommonJS is what I'd really like to have, but anything that gets me ES7+ would be fine. |
Sorry, but in that case this is operating as intended: microbundle/src/lib/babel-custom.js Lines 90 to 96 in 3aca5a0
Honestly, consumers should just be using the However, this is getting a bit off topic. If you wanted to create an issue for allowing modern output of other builds you can do so, but I'm not sure it'll be addressed. As for this issue, I haven't been able to look into it, but it'll probably be a bug with our fast rest transform or the |
Agreed, CJS has cost a lot of my time (not Microbundle's fault). Someday I'll be very excited about Sindre'ing all my packages, but I haven't worked up the nerve quite yet. I'll leave a comment on #618 for now. |
Yeah, I get that. The ecosystem is in a rough place, though showing some signs of improvement. However, I think our philosophy here is going to go the other way: it's been mentioned in a few issues that eventually we might switch over the legacy builds to their more verbose, correct forms (as Babel's Who knows if/when that'll happen though.
lol, I love that "Sindre'ing" is a verb |
description
async function with rest parameters seems got wrong function scope after transpiled
version
microbundle@^0.15.1
reproduce demo
The text was updated successfully, but these errors were encountered: