victorgarciaesgi / nuxt-typed-router

🚦Provide autocompletion and typecheck to Nuxt router
https://nuxt-typed-router.vercel.app
MIT License
354 stars 12 forks source link

types for .server pages won't get generated #110

Open arily opened 1 year ago

arily commented 1 year ago

Describe the bug types for .server pages won't be generated

Expected behavior types for .server pages should be generated like other pages.

Screenshots image image

Environnement infos

Your pages folder structure

pages
├── admin
│   ├── index.vue
│   ├── logs.vue
│   └── users.vue
├── admin.vue
├── article
│   ├── [...id].vue
│   └── edit.vue
├── auth
│   ├── login.vue
│   ├── logout.vue
│   └── register.vue
├── beatmap
│   └── [id].server.vue
├── beatmapset
│   └── [id].vue
├── error.vue
├── index.vue
├── leaderboard
│   └── [[mode]].vue
├── me
│   ├── relations.vue
│   └── settings.vue
├── score
│   ├── [id].vue
│   └── index.vue
├── status.vue
└── user
    └── [handle].vue

Your nuxt.config.ts

...
  modules: [
    // '@nuxtjs/color-mode',
    '@nuxtjs/tailwindcss',
    '@pinia/nuxt',
    '@nuxtjs/i18n',
    'nuxt-icon',
    'nuxt-typed-router',
  ],
  i18n: {
    strategy: 'prefix_and_default',
    defaultLocale: 'en-GB',
    locales: [
      {
        code: 'en-GB',
        name: 'English (International)',
      },
      {
        code: 'zh-CN',
        name: '简体中文 (中国)',
      },
    ],
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: 'n-lang',
      redirectOn: 'root', // recommended
    },
  },
...
victorgarciaesgi commented 1 year ago

I will look at it, are server routes supposed to be navigated to?

victorgarciaesgi commented 1 year ago

Is the route display on your vue/nuxt devtools?

arily commented 1 year ago

Is the route display on your vue/nuxt devtools?

yes.

image
arily commented 1 year ago

I will look at it, are server routes supposed to be navigated to?

right now it navigates with bug:

image image

(I am on Nuxt 3.5.3 so things may changed)

victorgarciaesgi commented 1 year ago

I'll investigate this, to see if there's a way to get the server routes. For now Nuxt isn't providing it for the classic pages behaviour