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

import { Vue } from 'vue-property-decorator' is invalid #301

Closed
5 tasks done
GenesisLQ opened this issue Dec 7, 2022 · 3 comments
Closed
5 tasks done

import { Vue } from 'vue-property-decorator' is invalid #301

GenesisLQ opened this issue Dec 7, 2022 · 3 comments

Comments

@GenesisLQ
Copy link

Describe the bug

image

image

我们用的 vue2 + class 的写法,在 webpack 里面同样的配置可以使用,但是 vite 不行,除了 Vue 以外所有的都可以自动导入,应该怎么解决这个问题?

versions:
vue: 2.7.4
vue-class-component: 7.2.6
vue-property-decorator: 9.1.2

Reproduction

https://github.com/GenesisLQ/unplugin-auto-import_Vue

System Info

System:
    OS: macOS 13.0
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 33.09 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.19.1 - ~/.nvm/versions/node/v14.19.1/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 6.14.16 - ~/.nvm/versions/node/v14.19.1/bin/npm
  Browsers:
    Chrome: 107.0.5304.121
    Safari: 16.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@sabasayer
Copy link

I think it is related with class components extending something.
I have an example that i am extending from some mixin and it is also not included in the build.
image
image
image

Here you can see there is no BaseMixin imported from @comed/common-vue:

image

@so1ve
Copy link
Member

so1ve commented May 16, 2023

I believe this is an unimport issue, let's track in unjs/unimport/issues/243

@antfu
Copy link
Member

antfu commented May 17, 2023

Close in favor of upstream issue

@antfu antfu closed this as completed May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants