N
Nuxtβ€’2mo ago
IsaacR943

[plugin:vite:vue] Codegen node is missing for element/if/for node. Apply appropriate transforms firs

UPDATE: Vue / vite error No clue how to solve this. Context - I have one layout passing props to the only slot. The props in this slot are used by all pages. For some reason the code breaks with the next implementation
// layout.vue
<main>
<slot
:headerContent="header"
:keyPartnerships="key_partnerships"
:keyActivities="key_activities"
:keyResources="key_resources"
></slot>

</main>
// layout.vue
<main>
<slot
:headerContent="header"
:keyPartnerships="key_partnerships"
:keyActivities="key_activities"
:keyResources="key_resources"
></slot>

</main>
// component that uses the slot
<template v-slot="{ headerContent, ... }" >

<dynamicScrollCard title="πŸ§‘πŸ»β€πŸ€β€πŸ§‘πŸ» Key Partners" content="another content" :mykey="keyPartnerships" />
....
</template>
// component that uses the slot
<template v-slot="{ headerContent, ... }" >

<dynamicScrollCard title="πŸ§‘πŸ»β€πŸ€β€πŸ§‘πŸ» Key Partners" content="another content" :mykey="keyPartnerships" />
....
</template>
im sure it has to do with templates.
1 Reply
IsaacR943
IsaacR943OPβ€’2mo ago
Update, this is a vue / vite error. I made the example as simple as possible and the thing still dont work. Example:
// layout.vue
<slot :headerContent="header"></slot>
// page.vue
<template #default="{ headerContent }">
<div>{{ headerContent }}</div>
</template>
// layout.vue
<slot :headerContent="header"></slot>
// page.vue
<template #default="{ headerContent }">
<div>{{ headerContent }}</div>
</template>
error:
ERROR Pre-transform error: Codegen node is missing for element/if/for node. Apply appropriate transforms first.

500
[vite-node] [plugin:vite:vue] [VITE_ERROR] /pages/chat.vue?macro=true
ERROR Pre-transform error: Codegen node is missing for element/if/for node. Apply appropriate transforms first.

500
[vite-node] [plugin:vite:vue] [VITE_ERROR] /pages/chat.vue?macro=true
Want results from more Discord servers?
Add your server