mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
Fix Vite 7.x TDZ error in __vite__mapDeps with post-build script
- Add post-build script to fix Temporal Dead Zone error in generated code - Remove debug logging from stores and composables - Simplify init-logger plugin to essential error handling - Fix circular store dependency in useUiStore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
25
src/plugins/init-logger.ts
Normal file
25
src/plugins/init-logger.ts
Normal file
@ -0,0 +1,25 @@
|
||||
export default defineNuxtPlugin({
|
||||
name: 'init-logger',
|
||||
enforce: 'pre',
|
||||
parallel: false,
|
||||
setup() {
|
||||
// Add global error handler for better debugging
|
||||
window.addEventListener('error', (event) => {
|
||||
console.error('[HaexHub] Global error caught:', {
|
||||
message: event.message,
|
||||
filename: event.filename,
|
||||
lineno: event.lineno,
|
||||
colno: event.colno,
|
||||
error: event.error,
|
||||
stack: event.error?.stack,
|
||||
})
|
||||
})
|
||||
|
||||
window.addEventListener('unhandledrejection', (event) => {
|
||||
console.error('[HaexHub] Unhandled rejection:', {
|
||||
reason: event.reason,
|
||||
promise: event.promise,
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
@ -1,5 +1,6 @@
|
||||
import { breakpointsTailwind } from '@vueuse/core'
|
||||
import { broadcastContextToAllExtensions } from '~/composables/extensionMessageHandler'
|
||||
|
||||
import de from './de.json'
|
||||
import en from './en.json'
|
||||
|
||||
@ -13,7 +14,6 @@ export const useUiStore = defineStore('uiStore', () => {
|
||||
const { locale } = useI18n({
|
||||
useScope: 'global',
|
||||
})
|
||||
const { platform } = useDeviceStore()
|
||||
|
||||
$i18n.setLocaleMessage('de', {
|
||||
ui: de,
|
||||
@ -62,11 +62,13 @@ export const useUiStore = defineStore('uiStore', () => {
|
||||
})
|
||||
|
||||
// Broadcast theme and locale changes to extensions
|
||||
watch([currentThemeName, locale], () => {
|
||||
watch([currentThemeName, locale], async () => {
|
||||
const deviceStore = useDeviceStore()
|
||||
const platformValue = await deviceStore.platform
|
||||
broadcastContextToAllExtensions({
|
||||
theme: currentThemeName.value,
|
||||
locale: locale.value,
|
||||
platform,
|
||||
platform: platformValue,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user