🛠️ Improve error handling and logging for search worker initialization

This commit is contained in:
2026-01-28 21:07:53 +00:00
parent b6707d75de
commit a2ec573d39

View File

@@ -403,7 +403,8 @@ const initSearchWorker = () => {
if (!searchWorker) { if (!searchWorker) {
try { try {
// Use Vite's ?worker syntax for proper bundling // Use Vite's ?worker syntax for proper bundling
import('../workers/search.worker.js?worker').then(module => { import('../workers/search.worker.js?worker')
.then(module => {
searchWorker = new module.default(); searchWorker = new module.default();
console.log('✅ Worker created successfully'); console.log('✅ Worker created successfully');
@@ -415,7 +416,8 @@ const initSearchWorker = () => {
}; };
console.log('✅ Worker event handlers attached'); console.log('✅ Worker event handlers attached');
}).catch(error => { })
.catch(error => {
console.error('❌ Failed to import worker:', error); console.error('❌ Failed to import worker:', error);
operationProgress.value.active = false; operationProgress.value.active = false;
operationProgress.value.message = 'Failed to initialize search'; operationProgress.value.message = 'Failed to initialize search';