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

[Bug]: Polyfill:"Usage",but the packaged product es5 syntax has a scope problem, causing my variables to be contaminated. #4143

Closed
PropersonCyber opened this issue Dec 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@PropersonCyber
Copy link

Version

System:
    OS: macOS 14.5
    CPU: (8) x64 Apple M1
    Memory: 42.29 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 131.0.6778.87
    Safari: 17.5

Details

I used polyfill:'usage' to configure compatibility with my browser, but the packaged product es5 syntax has a scope problem, causing my variables to be contaminated. In my code, show_type in 3 should be used instead of show_type in 1(figure 1 is the compiled code ). How do I fix this, Or is this a bug in rsbuild?
Image
Image

Reproduce link

https://codesandbox.io/p/github/rspack-contrib/rsbuild-codesandbox-example/csb-zktgdv/draft/great-flower?file=%2Fsrc%2FApp.jsx%3A11%2C54

Reproduce Steps

npm run build

checkout index.[hash].js , search "show_type" the result will be appear!!

@PropersonCyber PropersonCyber added the bug Something isn't working label Dec 6, 2024
@chenjiahan
Copy link
Member

The codesandbox link is invalid, can you have a look at it?

Image

@chenjiahan
Copy link
Member

Duplicated: web-infra-dev/rspack#8637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants