Skip to content

fix(vite): convert manualChunks to Function for Vite 8 compatibility#1095

Merged
pethers merged 2 commits intodependabot/npm_and_yarn/vite-8.0.0from
copilot/sub-pr-1094
Mar 12, 2026
Merged

fix(vite): convert manualChunks to Function for Vite 8 compatibility#1095
pethers merged 2 commits intodependabot/npm_and_yarn/vite-8.0.0from
copilot/sub-pr-1094

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

Vite 8 (Rolldown) dropped support for manualChunks as a plain object — it now requires a function.

Change

Convert manualChunks in vite.config.js from object to function form:

// Before (Vite 7 — object form, broken in Vite 8)
manualChunks: {
  'chart': ['chart.js', 'chartjs-plugin-annotation'],
  'd3': ['d3'],
  'papa': ['papaparse']
}

// After (Vite 8 — function form)
manualChunks(id) {
  if (id.includes('chart.js') || id.includes('chartjs-plugin-annotation')) return 'chart';
  if (id.includes('/node_modules/d3') || id.includes('/node_modules/d3-')) return 'd3';
  if (id.includes('papaparse')) return 'papa';
}

Chunk grouping behaviour is unchanged.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…mpatibility

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title [WIP] Bump vite from 7.3.1 to 8.0.0 fix(vite): convert manualChunks to Function for Vite 8 compatibility Mar 12, 2026
Copilot AI requested a review from pethers March 12, 2026 17:15
@pethers pethers marked this pull request as ready for review March 12, 2026 17:22
@pethers pethers merged commit 1928fea into dependabot/npm_and_yarn/vite-8.0.0 Mar 12, 2026
@pethers pethers deleted the copilot/sub-pr-1094 branch March 12, 2026 17:22
@pethers
Copy link
Member

pethers commented Mar 13, 2026

Root Cause Analysis

Investigated the failed workflow run #23017036455.

Root cause: The agent entered a data-gathering loop, making 6+ duplicate rounds of the same MCP queries:

  • get_sync_status called 3× (should be 1×)
  • get_calendar_events called 20+× (should be 2×)
  • search_voteringar, get_betankanden, search_anforanden, etc. each called 6+× (should be 1× each)

This consumed the entire context window with duplicate data, and the agent never progressed to article generation or safe output.

Contributing factors:

  1. No explicit anti-loop instruction in the workflow
  2. Large query limits (50-100 results per query) producing massive responses
  3. Agent reading full CONTENT_LABELS files (~14 languages × many keys) dumping huge tables
  4. No explicit phase completion markers

Fix Applied

  1. Anti-loop rules (Bump actions/upload-artifact from 4.6.2 to 6.0.0 #6, Bump github/codeql-action from 3.32.1 to 4.32.1 #7) added to NON-NEGOTIABLE RULES: each MCP tool AT MOST ONCE, forward-only phase progression
  2. Reduced query limits (50→15, 100→20) to prevent context overflow
  3. Time-check bash commands between every phase with hard cutoffs
  4. DATA PHASE COMPLETE marker after data gathering
  5. Simplified to EN/SV only (translations handled by news-translate workflow)
  6. Inlined Swedish CONTENT_LABELS to prevent large file reads
  7. Recompiled lock file with gh aw compile (v0.58.0)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants