Fail vite build on rolldown warnings via NODE_ENV=test#37270
Fail vite build on rolldown warnings via NODE_ENV=test#37270silverwind merged 12 commits intogo-gitea:mainfrom
Conversation
Top-level await (used in frontend-openapi-swagger.ts for the CSS import) requires es2022. This silences the TOLERATED_TRANSFORM warning emitted on each build. Browser support for es2022 is available in Chrome 94+, Firefox 93+ and Safari 15+. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Install an onwarn handler in commonRolldownOptions that throws when env.CI is set. In local builds the default handler still prints the warning, but CI promotes it to a build failure so tolerated warnings can't silently land on main. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
|
|
|
Actually, I am not sure whether it really needs This OK, it seems that it becomes standard in es2022, while some browsers supported it ahead. Maybe it's better to find a way to avoid such top-level await and make the CSS importing work (if possible) |
|
The top-level await import is also caused by incorrect Vite manifest parser, it makes the CSS importing very messy. |
|
No need to use es2022 -> Fix top-level await #37272 |
|
The warn-as-error here is still useful. |
Signed-off-by: silverwind <me@silverwind.io>
|
PR is now only warn-as-err. |
Depends on what vite internally does when it sees TLA with CSS. I think it's likely that some form of TLA persists in the output code, and if that is the case, rolldown is right to warn about it. |
Can this also have a proper fix? Throwing errors in |
|
While that case should probably be improved, it's not related to the change here, which is self-contained. |
|
The approach here has one issue, it will only log the first warning and exit. I think a real warn-as-err can only be implemented in vite itself. |
Yes, it's not related to the "rolldown warning", but it is still related to the CI build. For example: if the manifest.json generation goes wrong, the try-cache in I think they have the same point: vite build should report warnings/errors to stop the CI build. |
|
I opened vitejs/vite#22263, I think a proper implementation of this can only come from vite. |
This comment was marked as resolved.
This comment was marked as resolved.
Since I was pinged/subscribed here anyway, we've made more progress on ES standards compliance and some of the DOM issues we ran into before, so for the record, UXP now supports:
Maybe a casual read-through of our release notes can be useful for the dev team here, to know what's changed on our end. |
Thanks for the detailed info. With that confirmation, we could move to
Yes, that changelog is my primary resource for UXP compat issues. I still hope mdn/browser-compat-data#17690 will eventually be fixed. |
PaleMoon/UXP now supports the native SubmitEvent API (per go-gitea#37270 comment thread), so the polyfill added for it is dead weight. Remove the `submitEventSubmitter` wrapper, the `initSubmitEventPolyfill` init function, its two document.body listeners, and the `form._submitter` expando. Call sites use `e.submitter` directly. `repo-diff.ts` switches from `nodeName` string comparisons to `instanceof HTMLButtonElement` / `HTMLInputElement` for cleaner type narrowing. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a CI-only Rolldown plugin to make Vite builds fail when Rolldown warnings are emitted, preventing warnings from being silently ignored in CI.
Changes:
- Introduces a
failOnWarningsPlugin()Rolldown plugin that counts warning-level logs and fails the build atbuildEnd. - Wires the plugin into
commonRolldownOptionsonly whenenv.CIis set.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses review feedback: calling process.exit(1) from a plugin hook bypasses Vite/Rolldown cleanup and can truncate logs. Throwing routes failure through the normal error path. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Signed-off-by: silverwind <me@silverwind.io>
|
One more idea came to mind: fail it when in dev or test instead of only on CI. Not sure if it's possible, but likely. |
Switch from env.CI to env.NODE_ENV === 'test' and set NODE_ENV=test in the CI frontend/e2e build steps and in the test-e2e Makefile target. Local `make frontend` stays untouched; e2e runs fail on warnings both in CI and locally. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
|
Reverted, too complicated, and not backporting. |
This reverts commit f065993.
* main: (25 commits) Add URL to `Learn more about blocking a user` (go-gitea#37355) fix: use TriggerEvent instead of Event in workflow runs API response for scheduled runs (go-gitea#37288) Add event.schedule context for schedule actions task (go-gitea#37320) Fix typos (go-gitea#37346) Fix an issue where changing an organization’s visibility caused problems when users had forked its repositories. (go-gitea#37324) Fail vite build on rolldown warnings via NODE_ENV=test (go-gitea#37270) Use modern "git update-index --cacheinfo" syntax to support more file names (go-gitea#37338) Fix URL related escaping for oauth2 (go-gitea#37334) When the requested arch rpm is missing fall back to noarch (go-gitea#37236) Fix `relative-time` error and improve global error handler (go-gitea#37241) Enhance styling in actions page (go-gitea#37323) fix(oauth): Error on auth sources with spaces (go-gitea#37327) Fix actions concurrency groups cross-branch leak (go-gitea#37311) Fix bug when accessing user badges (go-gitea#37321) Fix AppFullLink (go-gitea#37325) Update go js dependencies (go-gitea#37312) Update GitHub Actions to latest major versions (go-gitea#37313) Revert "Add WebKit to e2e test matrix (go-gitea#37298)" (go-gitea#37315) Add `form-fetch-action` to some forms, fix "fetch action" resp bug (go-gitea#37305) Move heatmap to first-party code (go-gitea#37262) ...
* origin/main: (32 commits) fix: commit status reporting (go-gitea#37372) Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356) Fix cmd tests by mocking builtin paths (go-gitea#37369) chore: upgrade Go version in devcontainer image to 1.26 (go-gitea#37374) Fix button layout shift when collapsing file tree in editor (go-gitea#37363) Update `Block a user` form (go-gitea#37359) Remove IsValidExternalURL/IsAPIURL and use IsValidURL at call sites (go-gitea#37364) Add URL to `Learn more about blocking a user` (go-gitea#37355) fix: use TriggerEvent instead of Event in workflow runs API response for scheduled runs (go-gitea#37288) Add event.schedule context for schedule actions task (go-gitea#37320) Fix typos (go-gitea#37346) Fix an issue where changing an organization’s visibility caused problems when users had forked its repositories. (go-gitea#37324) Fail vite build on rolldown warnings via NODE_ENV=test (go-gitea#37270) Use modern "git update-index --cacheinfo" syntax to support more file names (go-gitea#37338) Fix URL related escaping for oauth2 (go-gitea#37334) When the requested arch rpm is missing fall back to noarch (go-gitea#37236) Fix `relative-time` error and improve global error handler (go-gitea#37241) Enhance styling in actions page (go-gitea#37323) fix(oauth): Error on auth sources with spaces (go-gitea#37327) Fix actions concurrency groups cross-branch leak (go-gitea#37311) ... # Conflicts: # services/actions/commit_status.go
* origin/main: (204 commits) fix: commit status reporting (go-gitea#37372) Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356) Fix cmd tests by mocking builtin paths (go-gitea#37369) chore: upgrade Go version in devcontainer image to 1.26 (go-gitea#37374) Fix button layout shift when collapsing file tree in editor (go-gitea#37363) Update `Block a user` form (go-gitea#37359) Remove IsValidExternalURL/IsAPIURL and use IsValidURL at call sites (go-gitea#37364) Add URL to `Learn more about blocking a user` (go-gitea#37355) fix: use TriggerEvent instead of Event in workflow runs API response for scheduled runs (go-gitea#37288) Add event.schedule context for schedule actions task (go-gitea#37320) Fix typos (go-gitea#37346) Fix an issue where changing an organization’s visibility caused problems when users had forked its repositories. (go-gitea#37324) Fail vite build on rolldown warnings via NODE_ENV=test (go-gitea#37270) Use modern "git update-index --cacheinfo" syntax to support more file names (go-gitea#37338) Fix URL related escaping for oauth2 (go-gitea#37334) When the requested arch rpm is missing fall back to noarch (go-gitea#37236) Fix `relative-time` error and improve global error handler (go-gitea#37241) Enhance styling in actions page (go-gitea#37323) fix(oauth): Error on auth sources with spaces (go-gitea#37327) Fix actions concurrency groups cross-branch leak (go-gitea#37311) ... # Conflicts: # web_src/js/index-domready.ts # web_src/js/markup/content.ts # web_src/js/markup/refissue.ts
* origin/main: (204 commits) fix: commit status reporting (go-gitea#37372) Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356) Fix cmd tests by mocking builtin paths (go-gitea#37369) chore: upgrade Go version in devcontainer image to 1.26 (go-gitea#37374) Fix button layout shift when collapsing file tree in editor (go-gitea#37363) Update `Block a user` form (go-gitea#37359) Remove IsValidExternalURL/IsAPIURL and use IsValidURL at call sites (go-gitea#37364) Add URL to `Learn more about blocking a user` (go-gitea#37355) fix: use TriggerEvent instead of Event in workflow runs API response for scheduled runs (go-gitea#37288) Add event.schedule context for schedule actions task (go-gitea#37320) Fix typos (go-gitea#37346) Fix an issue where changing an organization’s visibility caused problems when users had forked its repositories. (go-gitea#37324) Fail vite build on rolldown warnings via NODE_ENV=test (go-gitea#37270) Use modern "git update-index --cacheinfo" syntax to support more file names (go-gitea#37338) Fix URL related escaping for oauth2 (go-gitea#37334) When the requested arch rpm is missing fall back to noarch (go-gitea#37236) Fix `relative-time` error and improve global error handler (go-gitea#37241) Enhance styling in actions page (go-gitea#37323) fix(oauth): Error on auth sources with spaces (go-gitea#37327) Fix actions concurrency groups cross-branch leak (go-gitea#37311) ... Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com> # Conflicts: # web_src/js/index-domready.ts # web_src/js/markup/content.ts # web_src/js/markup/refissue.ts

Fail the vite build on any rolldown warnings when
NODE_ENV=testis set. This gate is set on the CImake frontendsteps (compliance and e2e workflows) and on the localmake test-e2etarget, so warnings fail the build both in CI and when running e2e tests locally. Regularmake frontend/ production builds are unaffected.Example output:
This PR was written with the help of Claude Opus 4.7