victorgarciaesgi / nuxt-typed-router

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

Type instantiation is excessively deep and possibly infinite #141

Closed christianlmc closed 9 months ago

christianlmc commented 9 months ago

Describe the bug Installed nuxt-typed-router on a clean nuxt project.

Running npx run typecheck gave me the following error

nuxt.config.ts:4:12 - error TS2589: Type instantiation is excessively deep and possibly infinite.

4   modules: [
             ~
5     'nuxt-typed-router',
  ~~~~~~~~~~~~~~~~~~~~~~~~
6   ]
  ~~~

Expected behavior No typescript errors

Screenshots image image

Environnement infos

Working directory: /home/christian/vue/nuxt-router-bug                                                        2:37:17 PM
Nuxt project info:                                                                                            2:37:17 PM

------------------------------
- Operating System: Linux
- Node Version:     v20.11.0
- Nuxt Version:     3.10.3
- CLI Version:      3.10.1
- Nitro Version:    2.8.1
- Package Manager:  npm@10.2.4
- Builder:          -
- User Config:      devtools, modules
- Runtime Modules:  nuxt-typed-router@3.6.0
- Build Modules:    -
------------------------------

Your pages folder structure

Not applicable

Your nuxt.config.ts

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: true },
  modules: [
    'nuxt-typed-router',
  ]
})
victorgarciaesgi commented 9 months ago

I'm reproducing it and don't know why it happens, looking at it thanks!

victorgarciaesgi commented 9 months ago

Have you reproduced it with any other modules?

victorgarciaesgi commented 9 months ago

After testing it happens only with Nuxt 3.10.3, the bug isn't here with 3.10.2. So likely a Nuxt bug

victorgarciaesgi commented 9 months ago

Also published a dep fix on my side on 3.6.1

christianlmc commented 9 months ago

Have you reproduced it with any other modules?

No, it seems like it only happens with nuxt-typed-router

christianlmc commented 9 months ago

Also published a dep fix on my side on 3.6.1

Updated to 3.6.1 and the issue is gone, thank you so much!