Closed nosizejosh closed 2 months ago
Hi @nosizejosh
According to your original bug report, your file D:/proj/components/details/Index.vue:205:64
indeed contains invalid javascript in the unMounted
hook
It could potentially be related to removeLoggers
, would you be ok to share your original code in the unMounted hook? It looks like vite transformed your original code.
hello @vejja
let cardServicesSubscription;
onMounted(async () => {
// fetching here removes delay and showing of empty content
const { data: card, error } = await fetchFullCard(selectedPipelineListCard.value.id, selectedPipelineList.value.id, getTenantProfile().id)
if (card) {
selectedPipelineListCard.value = card // set store selected card to the fresh full card
loading.value = false
}
if (error) {
console.log("🚀 ~ error:", error)
loading.value = false // end loading
showCardDetailsModal.value = false // hide slide over
}
cardServicesSubscription = cardServiceRealtimeSubscription(boardStore)
console.log("🚀 ~ onMounted ~ cardServicesSubscription:", cardServicesSubscription)
})
onUnmounted(() => {
removeCardServiceSubscription(cardServicesSubscription)
console.log("🚀 ~ onUnmounted ~ removeCardServiceSubscription(cardServicesSubscription):", removeCardServiceSubscription(cardServicesSubscription))
});
It's an upstream issue with https://github.com/Talljack/unplugin-remove.git Will file a report there
In the meantime, can you try disable the functionality in nuxt.config.ts
export default defineNuxtConfig({
security: {
removeLoggers: false
}
})
And let me know if it works ?
Thanks @vejja for taking care of it!
@nosizejosh let us know if that works for you
@vejja Thanks for the quick response.
Yes! build passed on both local and prod server.
Thank you for the package ( though I am now trying to understand how to really use it)
Will keep this open until a final resolution.
No problems @nosizejosh !
FYI removeLoggers
is a small additional utility to the core of Nuxt-Security that removes console.log
outputs in production. We are using the unplugin-remove package to do so but apparently there is a bug there and I think it is related to emojis.
By setting removeLoggers: false
in the config, we are not purging the browser console from your logs, but the rest of the Nuxt-Security core is still active.
In summary, you are good to go with this setup. Just remember that you may want to clean up your logs in your final production build.
@Baroshem FYI upstream was fixed today
Awesome, thanks @vejja !
I will add a bump of the package on our side and release it with the upcoming 1.3.0 release :)
Adding this package to my code leads to errors and prevents build. more on this error on this nuxt issue here https://github.com/nuxt/nuxt/issues/26011
Version
Build Modules: -