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

vue-tsc needs manual upgrade #515

Closed
abulte opened this issue Sep 3, 2024 · 1 comment · Fixed by #521
Closed

vue-tsc needs manual upgrade #515

abulte opened this issue Sep 3, 2024 · 1 comment · Fixed by #521
Assignees

Comments

@abulte
Copy link
Contributor

abulte commented Sep 3, 2024

#500 has surfaced new typing problems with the latest version of vue-tsc (2.1.4).

❯ npx vue-tsc --noEmit
src/components/bouquets/BouquetSearch.vue:185:10 - error TS2322: Type '(spatialCoverage: SpatialCoverage | null) => void' is not assignable to type '(modelValue: SpatialCoverage | undefined) => any'.
  Types of parameters 'spatialCoverage' and 'modelValue' are incompatible.
    Type 'SpatialCoverage | undefined' is not assignable to type 'SpatialCoverage | null'.
      Type 'undefined' is not assignable to type 'SpatialCoverage | null'.

185         @update:model-value="switchSpatialCoverage"
             ~~~~~~~~~~~~~~~~~~

src/views/bouquets/BouquetFormView.vue:184:13 - error TS2322: Type 'Partial<TopicPostData>' is not assignable to type 'Topic'.
  Type 'Partial<TopicPostData>' is not assignable to type '{ organization: null; owner: User; } & { name: string; description: string; created_at: string; last_modified: string; extras: TopicExtras; featured: boolean; id: string; ... 7 more ...; spatial: SpatialField | undefined; }'.
    Type 'Partial<TopicPostData>' is not assignable to type '{ organization: null; owner: User; }'.
      Types of property 'organization' are incompatible.
        Type 'Organization | null | undefined' is not assignable to type 'null'.
          Type 'undefined' is not assignable to type 'null'.

184             v-model="topic"
                ~~~~~~~


src/views/bouquets/BouquetFormView.vue:190:51 - error TS2322: Type 'Partial<TopicPostData>' is not assignable to type 'Topic'.

190           <BouquetOwnerForm v-if="isReadyForForm" v-model="topic" />
                                                      ~~~~~~~



Found 3 errors in 2 files.

Errors  Files
     1  src/components/bouquets/BouquetSearch.vue:185
     2  src/views/bouquets/BouquetFormView.vue:184
@abulte abulte moved this to 📋 Backlog in Ecosphères Sep 3, 2024
@narduin
Copy link
Contributor

narduin commented Sep 4, 2024

J'ai pu résoudre la première erreur

const switchSpatialCoverage = (
  spatialCoverage: SpatialCoverage | undefined | null
)

Mais alors les deux autres ça va me prendre un peu de temps pour comprendre la logique et le fonctionnement de vue-tsc.

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

Successfully merging a pull request may close this issue.

2 participants