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

definePage doesn't work with webpack #163

Open
undead-voron opened this issue May 13, 2023 · 4 comments · May be fixed by #488
Open

definePage doesn't work with webpack #163

undead-voron opened this issue May 13, 2023 · 4 comments · May be fixed by #488
Labels
👍 contribution welcome others are welcome to implement/fix this 🙏 help wanted help in this issue is welcome

Comments

@undead-voron
Copy link

undead-voron commented May 13, 2023

Usage on 'definePage' results in an error while building.
Error:
Module Error (from ./node_modules/vue-loader/dist/index.js): At least one <template> or <script> is required in a single file component.

Code sample

<script lang="ts" setup>
import {definePage} from 'vue-router/auto'
definePage({meta: {index: 1}})
const route = useRoute('/[id]')
</script>

<template>
  <main>With Id: {{ route.params.id }}</main>
</template>
@undead-voron
Copy link
Author

Hi @posva
here is a repo for reproduction https://github.com/undead-voron/unplugin-vue-router-webpack-example

use npm run dev for reproduction.

Here is a link to stackblitz just in case https://stackblitz.com/github/undead-voron/unplugin-vue-router-webpack-example?file=package.json

@tzhh0617
Copy link

tzhh0617 commented Aug 3, 2023

any update ?

@18949673125
Copy link

Have you solved this problem?

@tzhh0617
Copy link

tzhh0617 commented Oct 9, 2023

Is there a plan to fix this problem ?

@posva posva added 👍 contribution welcome others are welcome to implement/fix this 🙏 help wanted help in this issue is welcome labels Feb 21, 2024
@posva posva moved this to 🆕 New in unplugin-vue-router May 27, 2024
@zhangmo8 zhangmo8 linked a pull request Aug 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 contribution welcome others are welcome to implement/fix this 🙏 help wanted help in this issue is welcome
Projects
Status: 🆕 New
4 participants