From codeapps-toolkit
Diagnoses and fixes Power Apps Code Apps issues: deployment 404s, Dataverse OData errors, authentication failures, and build errors.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codeapps-toolkit:fix-codeapp-issueThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Diagnose and fix common Power Apps Code Apps issues with guided troubleshooting and automated repairs.
Diagnose and fix common Power Apps Code Apps issues with guided troubleshooting and automated repairs.
Symptoms:
GET .../assets/index-xxx.js net::ERR_ABORTED 404Refused to apply style ... MIME type ('application/json')Root Cause: Missing base: './' in vite.config.ts
Automated Fix:
// Check vite.config.ts
const config = await read('vite.config.ts');
if (!config.includes("base: './'")) {
// Add base: './' to config
const updated = config.replace(
'export default defineConfig({',
`export default defineConfig({\n base: './',`
);
await write('vite.config.ts', updated);
console.log('✅ Added base: "./" to vite.config.ts');
// Rebuild
await exec('npm run build');
// Suggest redeploy
console.log('💡 Run: pac code push');
}
Symptoms:
PrimitiveValue node with non-null value was found... 'ownerid'Root Cause: Sending system-managed fields (ownerid, statecode, timestamps, primary key)
Fix: Review service layer and remove system-managed fields:
// ❌ WRONG
const payload = {
name: dto.name,
ownerid: '', // Remove this
statecode: 0, // Remove this
};
// ✅ CORRECT
const payload = {
name: dto.name,
// Dataverse sets ownerid, statecode automatically
};
Symptoms:
Cannot convert the literal '1' to expected type 'Edm.Boolean'Root Cause: Generated types suggest numeric (0|1) but Dataverse expects boolean
Fix: Use as any type assertion:
// ❌ WRONG
updates.booleanField = value ? 1 : 0;
// ✅ CORRECT
updates.booleanField = value as any;
Symptoms:
pac code push fails with authentication errorFix:
pac auth clear
pac auth create
pac env select --environment <environmentId>
Symptoms:
npm run build exits with errorsDiagnostic Steps:
npm installnpx tsc --noEmitnpm run lintCommon Causes:
Symptoms:
pac code add-data-source failsFix:
# List connections
pac connection list
# If missing, user must create in Power Apps portal
echo "Create connection at: https://make.powerapps.com → Connections"
Symptoms:
npm run dev fails with "port already in use"Fix:
# Find process using port
netstat -ano | findstr :5173 # Windows
lsof -i :5173 # Mac/Linux
# Kill process or change port in package.json
Symptoms:
pac code init failsFix:
# Verify authentication
pac auth list
# Re-authenticate if needed
pac auth create
pac env select --environment <environmentId>
# Retry init
pac code init --displayName "AppName"
Ask user about symptoms:
Based on category, run appropriate checks:
For Deployment Issues:
# Check vite.config.ts
cat vite.config.ts | grep "base:"
# Check built assets
cat dist/index.html | grep -E 'src=|href='
# Verify power.config.json
cat power.config.json
For Data Issues:
pac connection listFor Build Issues:
# Run validation
Invoke codeapps-validator skill
Invoke build-lint-validator skill
Attempt automated fixes when possible:
base: './'as any to Boolean fields# Rebuild
npm run build
# Run validators
Invoke codeapps-validator skill
# Test locally
npm run dev
Provide tips to avoid future issues:
# Full project validation
Invoke codeapps-validator skill
# Build validation
npm run build
npm run lint
# Check authentication
pac auth list
# Check connections
pac connection list
# Check deployed apps
pac code list
# Check vite config
cat vite.config.ts | grep "base:"
# Check asset paths
cat dist/index.html | grep -E 'src=|href='
🔍 Diagnostic Report
❌ Issues Found:
1. [Issue description]
- Cause: [root cause]
- Impact: [what's affected]
🔧 Applied Fixes:
1. [Fix applied]
- File: [file path]
- Change: [what changed]
✅ Validation:
- Build: Pass/Fail
- TypeScript: Pass/Fail
- ESLint: Pass/Fail
💡 Prevention Tips:
- [Tip 1]
- [Tip 2]
📋 Next Steps:
1. [Action item]
2. [Action item]
Usage: Invoke when encountering errors or issues during development, build, or deployment. Provides diagnostic guidance and automated fixes.
Creates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.
npx claudepluginhub ramakrishnan24689/codeapps-toolkit --plugin codeapps-toolkit