Skip to content

Table<unknown> after updating to 3.1.0? #3982

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

Open
schillerenrico opened this issue Apr 25, 2025 · 4 comments
Open

Table<unknown> after updating to 3.1.0? #3982

schillerenrico opened this issue Apr 25, 2025 · 4 comments
Labels
bug Something isn't working v3 #1289

Comments

@schillerenrico
Copy link

Description

Table is now of type unknown after updating to 3.1.0 - worked before in 3.0.x
Did I miss anything?

 const table = useTemplateRef("table"); 
 const selectedRowsMapPositions = computed(() =>
    table.value?.tableApi
      ?.getFilteredSelectedRowModel()
      .rows.map((row) => row.original?.id)
      .filter(Boolean)
  );

Image

@schillerenrico schillerenrico added question Further information is requested v3 #1289 labels Apr 25, 2025
Copy link
Member

@schillerenrico I think this is the same issue as the one you created already (#3980). Would you mind providing a reproduction? I don't the issue myself.

@schillerenrico
Copy link
Author

@benjamincanac Sure, using the examples from the nuxt ui docs and some extra functions the ide is not getting the right type.
row is of type any or unknown instead of Payment.

https://codesandbox.io/p/devbox/strange-buck-dz55vr

@benjamincanac benjamincanac added bug Something isn't working and removed question Further information is requested labels Apr 25, 2025 — with Volta.net
@zguig52
Copy link
Contributor

zguig52 commented Apr 25, 2025

@schillerenrico and @benjamincanac , I had also same both issues when I tried to upgrade a project yesterday.

I first though I broke type inference with my change. I was suspecting this line:
const data = ref(props.data ?? []) as Ref<T[]>

But when I checked the nuxt ui playground directly I saw that I did not had this problem so I just roll-back due to lack of time.
@schillerenrico, when using your code in that playground of nuxt ui, there is no issue.

When searching for issues, I saw that typescript build files has changed and are no more in the same file. There might be something that nuxt clean and so do not fix.

There might be something to clear and restart typescript analysis required? I did not had such quick fix for the issue #3980.

Before upgrade:
Image

After upgrade:
Image

==> All types are removed and there is a new file specific with typescript stuff (ex: defineSlots)

@clopezpro
Copy link
Contributor

I have the same type error when updating

Image

clopezpro referenced this issue Apr 25, 2025
…ination` (#3177)

Co-authored-by: Sandros94 <[email protected]>
Co-authored-by: Benjamin Canac <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 #1289
Projects
None yet
Development

No branches or pull requests

4 participants