🛠️ Improve error handling and logging for search worker initialization
This commit is contained in:
@@ -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';
|
||||||
|
|||||||
Reference in New Issue
Block a user