fix: Corriger les erreurs d'initialisation et de communication
- Supprimer l'appel à initEssentialFunctions (fonction supprimée) - Ajouter le support pour le message IFRAME_READY - Améliorer les logs de validation WebSocket pour le debugging - Résoudre les erreurs ReferenceError et Unknown message type
This commit is contained in:
parent
69424c6bf6
commit
0b94cda76e
13
package.json
13
package.json
@ -28,17 +28,19 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.38.0",
|
"@eslint/js": "^9.38.0",
|
||||||
|
"@testing-library/jest-dom": "^6.1.4",
|
||||||
|
"@types/jest": "^29.5.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
||||||
"@typescript-eslint/parser": "^8.46.2",
|
"@typescript-eslint/parser": "^8.46.2",
|
||||||
"eslint": "^9.38.0",
|
"eslint": "^9.38.0",
|
||||||
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
|
"ts-jest": "^29.1.1",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vite": "^5.4.11",
|
"vite": "^5.4.11",
|
||||||
"vite-plugin-static-copy": "^1.0.6",
|
"vite-plugin-static-copy": "^1.0.6",
|
||||||
"jest": "^29.7.0",
|
"vite-plugin-top-level-await": "^1.6.0",
|
||||||
"ts-jest": "^29.1.1",
|
"vite-plugin-wasm": "^3.5.0"
|
||||||
"@types/jest": "^29.5.8",
|
|
||||||
"@testing-library/jest-dom": "^6.1.4"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.7.8",
|
"axios": "^1.7.8",
|
||||||
@ -47,7 +49,6 @@
|
|||||||
"pdf-lib": "^1.17.1",
|
"pdf-lib": "^1.17.1",
|
||||||
"sweetalert2": "^11.14.5",
|
"sweetalert2": "^11.14.5",
|
||||||
"vite-plugin-copy": "^0.1.6",
|
"vite-plugin-copy": "^0.1.6",
|
||||||
"vite-plugin-html": "^3.2.2",
|
"vite-plugin-html": "^3.2.2"
|
||||||
"vite-plugin-wasm": "^3.3.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -397,6 +397,10 @@ export function initIframeCommunication() {
|
|||||||
console.log('👂 Parent is listening for messages');
|
console.log('👂 Parent is listening for messages');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'IFRAME_READY':
|
||||||
|
console.log('✅ Iframe is ready and initialized');
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.log('❓ Unknown message type from parent:', type);
|
console.log('❓ Unknown message type from parent:', type);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,8 +61,7 @@ async function handleLocation(path: string) {
|
|||||||
|
|
||||||
await new Promise(requestAnimationFrame);
|
await new Promise(requestAnimationFrame);
|
||||||
|
|
||||||
// Initialize essential functions
|
// Essential functions are now handled directly in the application
|
||||||
await initEssentialFunctions();
|
|
||||||
|
|
||||||
// const modalService = await ModalService.getInstance()
|
// const modalService = await ModalService.getInstance()
|
||||||
// modalService.injectValidationModal()
|
// modalService.injectValidationModal()
|
||||||
|
|||||||
@ -34,7 +34,8 @@ export async function initWebsocket(url: string) {
|
|||||||
secureLogger.warn('Invalid WebSocket message received', {
|
secureLogger.warn('Invalid WebSocket message received', {
|
||||||
component: 'WebSocket',
|
component: 'WebSocket',
|
||||||
operation: 'message_validation',
|
operation: 'message_validation',
|
||||||
errors: validation.errors
|
errors: validation.errors,
|
||||||
|
messagePreview: msgData.substring(0, 100) // Log first 100 chars for debugging
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import path from 'path'
|
import path from 'path';
|
||||||
|
import wasm from 'vite-plugin-wasm';
|
||||||
|
import topLevelAwait from 'vite-plugin-top-level-await';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: ['qrcode']
|
include: ['qrcode']
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: [
|
||||||
|
wasm(),
|
||||||
|
topLevelAwait()
|
||||||
|
],
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist',
|
outDir: 'dist',
|
||||||
target: 'esnext',
|
target: 'esnext',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user