vite-plugin-vue-inspector
vite-plugin-vue-inspector copied to clipboard
Unexpected token, expected "}"
[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.
我也遇到这个Bug了
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 ?
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:
- You avoid conflicts: Other plugins, such as
vue, or any internal plugins, run first without interference from the .vue-router``vite-plugin-vue-devtoolsplugin. - It inspects correctly: DevTools can work with the final processing results of other plugins (e.g., generated routes, rendered components, etc.).