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

Type definition of useError() differs between document and actual #14999

Closed
uyamazak opened this issue Sep 22, 2022 · 1 comment · Fixed by nuxt/framework#7749
Closed

Type definition of useError() differs between document and actual #14999

uyamazak opened this issue Sep 22, 2022 · 1 comment · Fixed by nuxt/framework#7749

Comments

@uyamazak
Copy link
Sponsor Contributor

Environment


  • Operating System: Darwin
  • Node Version: v18.7.0
  • Nuxt Version: 3.0.0-rc.11
  • Nitro Version: 0.5.4
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: buildModules, meta, ssr, publicRuntimeConfig, css, tailwindcss
  • Runtime Modules: -
  • Build Modules: @nuxtjs/tailwindcss@5.3.3

Reproduction

document
https://v3.nuxtjs.org/getting-started/error-handling#useerror
https://github.com/nuxt/framework/blob/main/docs/content/1.getting-started/8.error-handling.md#useerror

type definition code
https://github.com/nuxt/framework/blob/main/packages/nuxt/src/app/nuxt.ts#L82

Describe the bug

Type of useError() return value is Ref<any> in document,

https://v3.nuxtjs.org/getting-started/error-handling#useerror

function useError (): Ref<any>

but actual below.

スクリーンショット 2022-09-22 16 18 06

https://github.com/nuxt/framework/blob/main/packages/nuxt/src/app/nuxt.ts#L82

Ref<Error | {
    url: string;
    statusCode: string;
    statusMessage: string;
    message: string;
    description: string;
    data?: any;
}>

Additional context

Probably because of the following changes

https://github.com/nuxt/framework/pull/6389/files

I will create a PR if the following change is acceptable.
nuxt/framework@main...uyamazak:framework:fix_userrror_type_in_doc

Logs

No response

Copy link
Member

It looks good to me - thank you ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants