fix: remove all MUI dependencies causing plugin load failure #3

Merged
cpfarhood merged 1 commits from fix/remove-mui-dependencies into main 2026-02-12 03:18:43 +00:00
cpfarhood commented 2026-02-12 03:18:37 +00:00 (Migrated from github.com)

Summary

  • Remove all @mui/material and @mui/icons-material imports
  • Replace with standard HTML elements and inline styles
  • Fixes browser error: TypeError: undefined is not an object (evaluating 'q.createSvgIcon')

Root Cause

The Headlamp plugin environment doesn't provide the full MUI library, causing createSvgIcon to be undefined when our plugin tries to use MUI icons and components.

Changes

  • AppBarScoreBadge.tsx: Replace Chip and ShieldIcon with <button> and 🛡️ emoji
  • DashboardView.tsx: Replace Button and RefreshIcon with <button> and 🔄 emoji
  • ExemptionManager.tsx: Replace all MUI form components with HTML <button>, <input type="checkbox">, <label>
  • PolarisSettings.tsx: Replace Button with HTML <button>

Test Plan

  • All tests passing (50/50)
  • TypeScript compilation clean (tsc --noEmit)
  • Build successful with no MUI references in bundle
  • Verified no createSvgIcon or @mui in dist/main.js

Verification

npx tsc --noEmit  # ✅ clean
npm test          # ✅ 50/50 passing
npx @kinvolk/headlamp-plugin build  # ✅ success
grep -c '@mui' dist/main.js  # 0 (no MUI imports)

🤖 Generated with Claude Code

## Summary - Remove all `@mui/material` and `@mui/icons-material` imports - Replace with standard HTML elements and inline styles - Fixes browser error: `TypeError: undefined is not an object (evaluating 'q.createSvgIcon')` ## Root Cause The Headlamp plugin environment doesn't provide the full MUI library, causing `createSvgIcon` to be undefined when our plugin tries to use MUI icons and components. ## Changes - **AppBarScoreBadge.tsx**: Replace `Chip` and `ShieldIcon` with `<button>` and 🛡️ emoji - **DashboardView.tsx**: Replace `Button` and `RefreshIcon` with `<button>` and 🔄 emoji - **ExemptionManager.tsx**: Replace all MUI form components with HTML `<button>`, `<input type="checkbox">`, `<label>` - **PolarisSettings.tsx**: Replace `Button` with HTML `<button>` ## Test Plan - ✅ All tests passing (50/50) - ✅ TypeScript compilation clean (`tsc --noEmit`) - ✅ Build successful with no MUI references in bundle - ✅ Verified no `createSvgIcon` or `@mui` in dist/main.js ## Verification ```bash npx tsc --noEmit # ✅ clean npm test # ✅ 50/50 passing npx @kinvolk/headlamp-plugin build # ✅ success grep -c '@mui' dist/main.js # 0 (no MUI imports) ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: privilegedescalation/headlamp-polaris-plugin#3