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

Incorrect types for NuxtConfig's loading and loadingIndicator declaration #1019

Closed
wJoenn opened this issue Dec 15, 2023 · 0 comments · Fixed by #1023
Closed

Incorrect types for NuxtConfig's loading and loadingIndicator declaration #1019

wJoenn opened this issue Dec 15, 2023 · 0 comments · Fixed by #1023

Comments

@wJoenn
Copy link

wJoenn commented Dec 15, 2023

Environment

node: 18.19.0
nuxt: 2.17.2
@nuxt/bridge: 3.0.0-rc.4-28374828.d03fbb4

Reproduction

It shouldn't be necessary

Describe the bug

export default defineNuxtConfig({
  loading: false,
  loadingIndicator: '~/page.html`
})

raises TypeScript errors saying

image
image
despite JSDoc saying

Configure the Nuxt loading progress bar component that's shown between routes. Set to false to disable. You can also customize it or create your own component.
and

Set to false to disable. Alternatively, you can pass a string name or an object for more configuration. The name can refer to an indicator from SpinKit or a path to an HTML template of the indicator source code (in this case, all the other options will be passed to the template).

Either the doc is deprecated or the types for these two attributes is not correct.
They should be

 // loading: {
 loading: false | {
  color: string,
  failedColor: string,
  height: string,
  throttle: number,
  duration: number,
  continuous: boolean,
  rtl: boolean,
  css: boolean,
 }

and

 // loadingIndicator {
 loadingIndicator: false | string | {
  [key: string]: any
 },

respectively

Additional context

No response

Logs

No response

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.

1 participant