-
Notifications
You must be signed in to change notification settings - Fork 769
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: this handling in static blocks results in undefined #7741
Comments
I ran into this in the |
Unable to reproduce the issue in workerd directly. Are you making use of wranglers transcoding mechanisms? For instance, are you using typescript or any kind of bundling? Specifically, syntax like this is handled by v8, the same as node.js, so there should be no difference in behavior in the runtime and quick testing demonstrates that. However, I can imagine something in the transcoding process getting in the way... in which case this issue should be transfered over to the wrangler repo |
Yes, I believe it is using the internal wrangler wrangler.toml:
|
@dario-piotrowicz ... any ideas here? |
This is 100% a building issue This can be clearly seen with And it is actually an issue with esbuild (which we use for bundling) that I reproduced in node itself without workerd being involved at all: The issue has actually already been fixed in |
@penalosa I've transferred the issue back to workers-sdk since as I mentioned in my comment I am pretty sure that this is a wrangler issue, I hope you don't mind, please let me know if you disagree 🙂 |
Thanks for diagnosing, @dario-piotrowicz! This will be fixed in the upcoming Wrangler v4, which you can try out by installing |
Yay, that sounds great 😄 And yes I can confirm that the issue seem to be fixed in |
I'm going to close this—it was fixed for v4 in #6884, and will be released as part of Wrangler v4 soon. In the meantime, you can access this fix via |
Which Cloudflare product(s) does this pertain to?
Wrangler
What versions are you using?
wrangler 3.100.0
What operating system and version are you using?
MacOS Sequoia
Please provide a link to a minimal reproduction
No response
Describe the Bug
The following minimal worker script doesn't seem to behave correctly wrt static blocks:
In the browser and node, both
this
are defined, which seems correct.However, in wrangler, the second
this
is undefined. Removing thestatic a = 1;
seems to make a difference and results in the correct static block behavior.Is this a specification implementation bug in the wrangler JS runtime?
Please provide any relevant error logs
The text was updated successfully, but these errors were encountered: