Skip to content
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

commonjs: this is incorrectly transformed in class field initializers #922

Closed
connorjclark opened this issue Jul 3, 2021 · 8 comments
Closed

Comments

@connorjclark
Copy link

connorjclark commented Jul 3, 2021

  • Rollup Plugin Name: commonjs
  • Rollup Plugin Version: 10.1.0
  • Rollup Version: 2.52.7
  • Operating System (or Browser): n/a
  • Node Version: n/a
  • Link to reproduction: https://replit.com/@hoten/rollup-repro

Expected Behavior

this in class fields should not be transformed.

Actual Behavior

this is transformed to commonjsGlobal.

Additional Information

A workaround is to set ignoreGlobal: true.

if the word require is in the module then this issue does not occur (even if it exists only in a comment). So another workaround is literally a "magic comment":

// require <<< DON'T TOUCH OR THE BUILD BREAKS
@connorjclark connorjclark changed the title this is incorrectly transformed in class field initializers commonjs: this is incorrectly transformed in class field initializers Jul 4, 2021
@stale stale bot added the x⁷ ⋅ stale label Sep 2, 2021
@stale
Copy link

stale bot commented Sep 4, 2021

Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

@stale stale bot closed this as completed Sep 4, 2021
@connorjclark
Copy link
Author

Any thoughts?

@arackaf

This comment was marked as off-topic.

@connorjclark

This comment was marked as off-topic.

@arackaf

This comment was marked as off-topic.

@connorjclark

This comment was marked as off-topic.

@shellscape
Copy link
Collaborator

Folks, this is the not the place for discussion of issue management in this repo or org. Snark is not constructive. There are plenty of other mediums for venting. The message we've chosen for the bot is clear and concise. Please cease off-topic discussion in this issue.

@arackaf
Copy link

arackaf commented Apr 11, 2022

Fair enough but can we please reopen this ticket for visibility? It's manifesting in upstream tools like Vite.

vitejs/vite#7676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants