ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.12k stars 14.64k forks source link

[Bug Report] Interface'NuxtApp'incorrectly extended interface'Vue #17329

Open herrdu opened 5 years ago

herrdu commented 5 years ago

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 git@github.com: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; }; }'.

element-bot commented 5 years ago

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 git@github.com: 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;};}'.

rupertqin commented 5 years ago

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
yangfan-coder commented 4 years ago

I also have this problem

image

MengZaiL commented 4 years ago

I also have this problem

image

solved ?

tleperou commented 4 years ago

:+1:

yangfan-coder commented 4 years ago

我也有这个问题 图片

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

hoophony commented 4 years ago

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

JuanDelgado06 commented 4 years ago

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"
  ]
}
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

FlorianWendelborn commented 3 years ago

Please don’t close this issue