jacobinwwey_obsidian-NotEMD/docs/dist/test-debug.html
Jacobinwwey 121bee0f5d fix(standalone-bundle): correct export transformation for Vue components
## Bug Fix
- Fix empty slide rendering in standalone HTML bundles
- Root cause: export {X as default} only generated module.exports.default=X
- Solution: Generate dual assignment module.exports.default=module.exports=X
- Result: Vue components now load correctly, all slides display content

## Documentation Added
- docs/STANDALONE_BUNDLE_FIX.md - Detailed bug fix analysis
- BUNDLE_SCRIPTS_README.md - Bundler scripts reference
- docs/export/README.md - User export guide
- docs/dist/README.md - Build output reference
- CHANGELOG_STANDALONE_BUNDLE.md - Version history
- .github/BUNDLE_EXPORT_GUIDE.md - Contributor guide
- DOCUMENTATION_INDEX.md - Complete documentation index
- SUMMARY.md - Update summary

## Documentation Updated
- docs/SINGLE_FILE_BUNDLER.md - Added bugfix section
- docs/README.md - Added slide export documentation links
- test-bundle-FIXED.js - Added header comments

## Testing
- Automated verification: PASS
- Visual test: Content displays correctly
- Cross-browser: Chrome, Firefox, Edge verified
- Protocol: file:// and http:// both working
2026-06-16 04:48:46 -05:00

99 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Debug Standalone HTML</title>
<style>
body { font-family: monospace; padding: 20px; }
pre { background: #f0f0f0; padding: 10px; overflow-x: auto; }
.error { color: red; }
.success { color: green; }
</style>
</head>
<body>
<h1>Debugging Standalone HTML</h1>
<div id="log"></div>
<script>
const log = document.getElementById('log');
function addLog(message, isError) {
const div = document.createElement('div');
div.className = isError ? 'error' : 'success';
div.textContent = message;
log.appendChild(div);
console.log(message);
}
// Capture all console output
const originalConsoleLog = console.log;
const originalConsoleError = console.error;
const originalConsoleWarn = console.warn;
console.log = function(...args) {
addLog('[LOG] ' + args.join(' '), false);
originalConsoleLog.apply(console, args);
};
console.error = function(...args) {
addLog('[ERROR] ' + args.join(' '), true);
originalConsoleError.apply(console, args);
};
console.warn = function(...args) {
addLog('[WARN] ' + args.join(' '), false);
originalConsoleWarn.apply(console, args);
};
// Capture uncaught errors
window.onerror = function(msg, url, line, col, error) {
addLog('[UNCAUGHT ERROR] ' + msg + ' at line ' + line, true);
return false;
};
window.addEventListener('unhandledrejection', function(event) {
addLog('[UNHANDLED REJECTION] ' + event.reason, true);
});
addLog('Debug system initialized', false);
addLog('Loading standalone HTML...', false);
// Load the standalone HTML content directly
fetch('index-standalone.html')
.then(response => response.text())
.then(html => {
addLog('Loaded HTML: ' + html.length + ' bytes', false);
// Extract and execute the script
const scriptMatch = html.match(/<script type="text\/javascript">([\s\S]*?)<\/script>/);
if (!scriptMatch) {
addLog('ERROR: Could not find script tag!', true);
return;
}
const scriptContent = scriptMatch[1];
addLog('Found script: ' + scriptContent.length + ' bytes', false);
// Execute the script
try {
addLog('Executing script...', false);
eval(scriptContent);
addLog('Script executed successfully', false);
// Check if __require exists
if (typeof window.__require === 'function') {
addLog('✓ __require function exists', false);
} else {
addLog('✗ __require function NOT found', true);
}
} catch (error) {
addLog('ERROR executing script: ' + error.message, true);
addLog('Stack: ' + error.stack, true);
}
})
.catch(error => {
addLog('ERROR loading HTML: ' + error.message, true);
});
</script>
</body>
</html>