vite-plugin-vue-inspector icon indicating copy to clipboard operation
vite-plugin-vue-inspector copied to clipboard

Unexpected token, expected "}"

Open 0asys opened this issue 1 year ago • 2 comments

[plugin:vite-plugin-vue-inspector] unknown: Unexpected token, expected "}" (5:6)
  8 | })
src/ui/pages/settings.vue:5:6
3  |  
4  |  definePage({
5  |    meta: {
   |        ^
6  |      requiresAuth: true
7  |    },

definePage originates from unplugin-vue-router.. Deactivating vue-dev-tools(https://devtools-next.vuejs.org/) seems to mitigate the error.

not sure where the culprit is.

0asys avatar Aug 21 '24 11:08 0asys

image 我也遇到这个Bug了

songpeng154 avatar Sep 12 '24 10:09 songpeng154

I don't have the bug when I use the 0.9.1 version.

This bug occurs from 0.10.0 release of unplugin-vue-router...

Do you have found a work around ?

mdartic avatar Oct 25 '24 10:10 mdartic

My solution plugins: [ VueRouter(), PurgeComments(), another(), another() DevTools(), ]

That's great! Moving the DevTools() plugin to the end of the plugin list is a very logical solution, as plugins in Vite are processed in the order they appear in the list. By placing it at the end:

  1. You avoid conflicts: Other plugins, such as vue, or any internal plugins, run first without interference from the . vue-router``vite-plugin-vue-devtools plugin.
  2. It inspects correctly: DevTools can work with the final processing results of other plugins (e.g., generated routes, rendered components, etc.).

CarlosIvanHuerta avatar Jun 18 '25 19:06 CarlosIvanHuerta