posva / unplugin-vue-router

Next Generation file based typed routing for Vue Router
https://uvr.esm.is
MIT License
1.62k stars 79 forks source link

BUG: `definePage` causes jsx error in version 0.10.0 #428

Closed A-kirami closed 3 months ago

A-kirami commented 3 months ago

Description: After updating to version 0.10.0, I encountered the following error when using definePage:

12:36:36 [vite] Internal server error: Unexpected token, expected "}" (3:10)
  Plugin: unplugin-vue-jsx-directive
  File: C:/Users/.../src/views/index.vue?definePage&vue&lang.tsx:3:10
  1  |  <script setup lang="ts">
  2  |  definePage({
  3  |    redirect: '/',
     |              ^
  4  |  })
  5  |  </script>

I have tested this issue and confirmed that it does not occur in version 0.9.1.

Possible Cause: I suspect that the issue might be related to this commit: https://github.com/posva/unplugin-vue-router/commit/4fbff23666bb3fcf9ad7fcbc0d6ceda9d2c45d7f

Please let me know if any additional information is needed. Thank you!