Element: [Bug Report] Interface'NuxtApp'incorrectly extended interface'Vue

Created on 5 Sep 2019  ·  8Comments  ·  Source: ElemeFE/element

Element UI version

2.12.0

OS/Browsers version

macos/chrome

Vue version

2.6.10

Reproduction Link

https://github.com/iwata/codesandbox-nuxt

Steps to reproduce

$ git clone [email protected]:iwata/codesandbox-nuxt.git
$ yarn install
$ yarn dev

What is Expected?

不报错

What is actually happening?

ERROR in /Users/iwata/.go/src/github.com/iwata/codesandbox-nuxt/node_modules/@nuxt/vue-app/types/index.d.ts(73,18):
TS2430: Interface 'NuxtApp' incorrectly extends interface 'Vue'.
Types of property '$loading' are incompatible.
Property 'open' is missing in type 'NuxtLoading' but required in type '{ open: (params: LoadingConfig) => { close: () => any; }; }'.

Most helpful comment

我也有这个问题
图片

解决了 ?
Do the following
tsconfig.json
compilerOptions :{"skipLibCheck": true}

All 8 comments

Translation of this issue:

Element UI version

2.12.0

OS/Browsers version

Macos/chrome

Vue version

2.6.10

Reproduction Link

Https://github.com/iwata/codesandbox-nuxt

Steps to reproduce

Git clone [email protected]: iwata/codesandbox-nuxt.git

Yarn install
$yarn dev

What is Expected?

No error reporting

What is actually happening?

ERROR in/Users/iwata/.go/src/github.com/iwata/codesandbox-nuxt/node_modules/@nuxt/vue-app/types/index.d.ts(73,18):

TS2430: Interface'NuxtApp'incorrectly extends interface'Vue'.
Types of property'$loading'are incompatible.

Property'open'is missing in type'NuxtLoading' but required in type'{open: (params: Loading Config) => {close: () => any;};}'.

I got this problem too.

0:18 Interface 'NuxtApp' incorrectly extends interface 'Vue'.
  Types of property '$loading' are incompatible.
    Type 'NuxtLoading' is not assignable to type '(options: LoadingServiceOptions) => ElLoadingComponent'.
      Type 'NuxtLoading' provides no match for the signature '(options: LoadingServiceOptions): ElLoadingComponent'.
    88 | }
    89 |
  > 90 | export interface NuxtApp extends Vue {
       |                  ^
    91 |   $options: NuxtAppOptions
    92 |   $loading: NuxtLoading
    93 |   context: Context

I also have this problem

image

I also have this problem

image

solved ?

:+1:

我也有这个问题
图片

解决了 ?
Do the following
tsconfig.json
compilerOptions :{"skipLibCheck": true}

I also have the problem when i using typescript. solved ?

I have this configuration in my tsconfig.json and it works fine for the moment

{
  "compilerOptions": {
    "target": "es2018",
    "module": "esnext",
    "moduleResolution": "node",
    "lib": [
      "esnext",
      "esnext.asynciterable",
      "dom"
    ],
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "sourceMap": true,
    "strict": true,
    "skipLibCheck": true,
    "noEmit": true,
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "./*"
      ],
      "@/*": [
        "./*"
      ]
    },
    "types": [
      "@types/node",
      "@nuxt/types"
    ]
  },
  "exclude": [
    "node_modules"
  ]
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

akaylh picture akaylh  ·  3Comments

makunsusu picture makunsusu  ·  3Comments

smallpath picture smallpath  ·  3Comments

Kingwl picture Kingwl  ·  3Comments

dbskccc picture dbskccc  ·  3Comments