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

RouterView is not rendering correctly after updating to the latest version #320

Closed
awdr74100 opened this issue Feb 22, 2024 · 2 comments
Closed
Labels
🐞 bug this isn't working as expected

Comments

@awdr74100
Copy link

awdr74100 commented Feb 22, 2024

repo: https://github.com/awdr74100/unplugin-vue-router-bug-reproduction

package.json

{
  "dependencies": {
    "vue": "^3.4.15",
    "vue-router": "^4.3.0"
  },
  "devDependencies": {
    "unplugin-vue-router": "^0.8.1"
  }
}

typed-router.d.ts on windows:

declare module 'vue-router/auto-routes' {
  import type {
    RouteRecordInfo,
    ParamValue,
    ParamValueOneOrMore,
    ParamValueZeroOrMore,
    ParamValueZeroOrOne,
  } from 'unplugin-vue-router/types'

  /**
   * Route name map generated by unplugin-vue-router
   */
  export interface RouteNamedMap {
    '/C:/Users/a7894/Desktop/unplugin-vue-router-bug-reproduction/src/pages/': RouteRecordInfo<'/C:/Users/a7894/Desktop/unplugin-vue-router-bug-reproduction/src/pages/', '/C:/Users/a7894/Desktop/unplugin-vue-router-bug-reproduction/src/pages', Record<never, never>, Record<never, never>>,
    '/C:/Users/a7894/Desktop/unplugin-vue-router-bug-reproduction/src/pages/about': RouteRecordInfo<'/C:/Users/a7894/Desktop/unplugin-vue-router-bug-reproduction/src/pages/about', '/C:/Users/a7894/Desktop/unplugin-vue-router-bug-reproduction/src/pages/about', Record<never, never>, Record<never, never>>,
  }
}

typed-router.d.ts on macos:

declare module 'vue-router/auto-routes' {
  import type {
    RouteRecordInfo,
    ParamValue,
    ParamValueOneOrMore,
    ParamValueZeroOrMore,
    ParamValueZeroOrOne,
  } from 'unplugin-vue-router/types'

  /**
   * Route name map generated by unplugin-vue-router
   */
  export interface RouteNamedMap {
  export interface RouteNamedMap {
    '//Users/lanyiru/Desktop/unplugin-vue-router-bug-reproduction/src/pages/': RouteRecordInfo<'//Users/lanyiru/Desktop/unplugin-vue-router-bug-reproduction/src/pages/', '/Users/lanyiru/Desktop/unplugin-vue-router-bug-reproduction/src/pages', Record<never, never>, Record<never, never>>,
    '//Users/lanyiru/Desktop/unplugin-vue-router-bug-reproduction/src/pages/about': RouteRecordInfo<'//Users/lanyiru/Desktop/unplugin-vue-router-bug-reproduction/src/pages/about', '/Users/lanyiru/Desktop/unplugin-vue-router-bug-reproduction/src/pages/about', Record<never, never>, Record<never, never>>,
  }}
}

Everything worked fine in v0.7.0, but in the latest version the RouterView is not rendered, and the generated type file doesn't seem to be correct.

Are there any settings I haven't noticed that need to be changed? For the most basic applications it seems that you only need to change the types setting in tsconfig.json.

Thank you for all your help!

@posva posva added the 🐞 bug this isn't working as expected label Feb 22, 2024
@posva
Copy link
Owner

posva commented Feb 22, 2024

The default setting seems broken. Explicitly set routesFolder to src/pages to fix this in the meantime

@posva posva closed this as completed in 1ed1eda Feb 22, 2024
@posva
Copy link
Owner

posva commented Feb 22, 2024

Fixed and released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug this isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants