Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting syntax errors while using Vite with vue3/router4 #2256

Closed
omkar-kanekar1-tfs opened this issue May 29, 2024 · 1 comment
Closed

Getting syntax errors while using Vite with vue3/router4 #2256

omkar-kanekar1-tfs opened this issue May 29, 2024 · 1 comment

Comments

@omkar-kanekar1-tfs
Copy link

omkar-kanekar1-tfs commented May 29, 2024

Reproduction

Details on code

Steps to reproduce the bug

<router-view v-slot="{ Component }">
    <component
      :is="Component"
      class="container"
      ref="componentRef"
    />
  </router-view>

This is my router code.

Getting below error:
[plugin:vite:vue] v-slot can only be used on components or tags.

Tried to rewrite syntax:

<router-view>
  <template v-slot="{ Component }">
    <component
      :is="Component"
      class="container"
      ref="componentRef"
    />
  </template>
</router-view>

Getting different error:
Codegen node is missing for element/if/for node. Apply appropriate transforms first.

Expected behavior

As per error, if v-slot is not allowed on , there should be alternate approach which should work without errors.

Actual behavior

Getting error: [plugin:vite:vue] v-slot can only be used on components or tags.

Additional information

No response

@posva
Copy link
Member

posva commented May 29, 2024

This doesn’t seem to come from the router but from the vite plugin.
BTW follow the issue guidelines next times please

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@vuejs vuejs locked as spam and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants