-
Notifications
You must be signed in to change notification settings - Fork 131
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]: Lottie breaks in production builds (output.minify
bug)
#3007
Comments
Wondering if it's any way related to web-infra-dev/rspack#5656 |
output.minify
bug)
After some investigation, this seems to be related to |
Maybe this bug has been fixed by the latest version of SWC, we will update the SWC version in Rspack soon. SWC introduces many AST breaking changes recently, so the upgrade will take some time. |
@matteom-synth can you try Rsbuild v1.0.1-beta.6? Now using the latest SWC minimizer. |
@chenjiahan the issue is still there in |
Yes, I have reproduced this issue, it should be a bug of SWC. You can submit an issue to the SWC repo, and it is also allowed to use Terser to replace the SWC minimizer of Rsbuild, see https://rsbuild.dev/guide/basic/configure-swc#switching-minimizer |
@chenjiahan sorry for the slow reponse, I'm on parental leave. What version of |
@matteom-synth You can refer to Rsbuild - SWC Plugin Version |
Version
Details
While migrating our companies codebase to Rsbuild (we're sooo close to enable it in production too) I discovered a bug that is blocking us: LottiePlayer (a web component) works fine in dev, but crashes the app in production. This issue seems to happen only in conjunction with imports from other libraries (e.g., in the attached repro we're importing also @datadog/browser-logs). Removing the additional library imports make the app work fine both in dev and in prod. Additionally, disabling
output.minify
also fixes the issue.I created a minimail issue repro. Let me know if you need more details. Thanks!
Reproduce link
https://github.com/matteom-synth/rsbuild-issue-repro-4
Reproduce Steps
Copy pasting here the repro's README.md
Setup
Install the dependencies:
Reproduce the issue
1. Check local build (works fine)
Start the dev server:
Check the app: you'll see it works fine.
2. Check prod build (it's broken)
Build and preview the app for production:
pnpm build & pnpm preview
❌ You'll see it erroring out with
TypeError: Cannot read properties of undefined (reading 'createElement')
.3. Try removing the other import (works fine)
Try removing the following:
And try building and previewing again: you'll see that the app works fine.
The text was updated successfully, but these errors were encountered: