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

Build errors in unrelated tsx files #47

Open
hisuwh opened this issue Nov 3, 2021 · 30 comments
Open

Build errors in unrelated tsx files #47

hisuwh opened this issue Nov 3, 2021 · 30 comments
Labels
bug Something isn't working

Comments

@hisuwh
Copy link

hisuwh commented Nov 3, 2021

I'm unable to upgrade from [email protected] to latest v0.5.11 as I am getting build errors in my Vue TSX files that are not using charts:

TS2322: Type '{ src: string; width: string; height: string; border: string; }' is not assignable to type 'ElementAttrs<IframeHTMLAttributes>'.
 Property 'border' does not exist on type 'ElementAttrs<IframeHTMLAttributes>'.
   42 |                                 width="100%"
   43 |                                 height="800px"
 > 44 |                                 border="none"
      |                                 ^^^^^^
   45 |                             >
   46 |                             </iframe>
   47 |                         )}

I notice you have taken a dependency on @vue/runtime-core and @vue/runtime-dom v3.2.20 (https://github.com/victorgarciaesgi/vue-chart-3/blob/main/package.json#L54) - I wonder if this could be a factor?

@victorgarciaesgi
Copy link
Owner

Hum that's weird. Do you use the JSX shim? I think a will release a version specifically for Vue 3 and another for Vue 2. It becomes too complicated to manage dependencies and types with only vue-demi. I will keep a branch updated for Vue 2

@hisuwh
Copy link
Author

hisuwh commented Nov 3, 2021

I've been going through the versions and it looks like v0.4.10 is when it started breaking. Which looks like when you introduced the dependency on @vue/runtime-core and @vue/runtime-dom: v0.4.8...v0.4.10

I think a will release a version specifically for Vue 3 and another for Vue 2. It becomes too complicated to manage dependencies and types with only vue-demi

Yes I imagine that would be complicated

@maiolica
Copy link

maiolica commented Nov 7, 2021

I'm having a similar issue, downgrading to v0.4.8 fixes this, thanks @hisuwh for the hint.

@victorgarciaesgi
Copy link
Owner

Sorry for the lack of updates, I don't have much time recently to work on it. Will keep you updated

@victorgarciaesgi victorgarciaesgi added the bug Something isn't working label Nov 7, 2021
@victorgarciaesgi
Copy link
Owner

@hisuwh @maiolica New version only for Vue 3 is out. With a legacy 2.x for Vue 2! Check out the new docs :)

@victorgarciaesgi
Copy link
Owner

Tell me if that fixes your problem

@maiolica
Copy link

Hi Victor, it seems to be working great, thank you for your work on the docs too!

@hisuwh
Copy link
Author

hisuwh commented Nov 23, 2021

I'm getting a new error now:

 Property 'class' does not exist on type 'Readonly<Partial<{ height: number; width: number; plugins: Plugin<keyof ChartTypeRegistry, AnyObject>[]; chartId: string; cssClasses: string; }> & Omit<...>>'.
    25 |         return (
    26 |             <Doughnut
  > 27 |                 class="position-relative h-100"
       |                 ^^^^^
    28 |                 chartData={chartData}
    29 |                 options={chartOptions}
    30 |             />

@victorgarciaesgi
Copy link
Owner

@hisuwh Volar is returning this error? I'll check if htmlAttrs is declared

@victorgarciaesgi
Copy link
Owner

Oh it's on tsx render function sorry

@victorgarciaesgi
Copy link
Owner

Hmm no error on my side
image

@victorgarciaesgi
Copy link
Owner

Oh ok it's the build step that fails. Weird

@hisuwh
Copy link
Author

hisuwh commented Nov 23, 2021

What if you assign the props explicitly rather than spread?

@hisuwh
Copy link
Author

hisuwh commented Nov 23, 2021

I get the error on build and in Vs code

@victorgarciaesgi
Copy link
Owner

I know where it comes from. I use the type ExtractPropTypes and it's not made for tsx. I will fix it tonight

@victorgarciaesgi
Copy link
Owner

@hisuwh Should be fixed on 3.0.1

@hisuwh
Copy link
Author

hisuwh commented Nov 23, 2021

3.0.1? I'm using Vue 2. Is that right?

@victorgarciaesgi
Copy link
Owner

Oh shit I though you were on Vue 3 aha

@hisuwh
Copy link
Author

hisuwh commented Nov 24, 2021

My bad tbf - I never specified

@victorgarciaesgi
Copy link
Owner

@hisuwh Try 2.0.2 it should work now

@hisuwh
Copy link
Author

hisuwh commented Nov 25, 2021

Mmm same problem.
image

@hiro05097952
Copy link

hiro05097952 commented Dec 9, 2021

I'm having a similar error in Vue3 version
it's worked on 0.4.8

ERROR in src/views/transaction-management/withdraw-review/index.vue:382:19
TS2339: Property '$t' does not exist on type 'ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>'.
    380 |       const fileName = `${dayjs(param[`${conditions.dateType}_at_before`]).format(
    381 |         'YYYYMMDD'
  > 382 |       )}-${proxy?.$t('menu.withdraw_review')}.csv`
        |                   ^^
    383 |       downloadFile('/manage/report/withdraw/', fileName, param)
    384 |     }
    385 |

@victorgarciaesgi
Copy link
Owner

@hisuwh sorry i don't have much time lately i will look into it

@victorgarciaesgi
Copy link
Owner

I'm having a similar error in Vue3 version

it's worked on 0.4.8


ERROR in src/views/transaction-management/withdraw-review/index.vue:382:19

TS2339: Property '$t' does not exist on type 'ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>'.

    380 |       const fileName = `${dayjs(param[`${conditions.dateType}_at_before`]).format(

    381 |         'YYYYMMDD'

  > 382 |       )}-${proxy?.$t('menu.withdraw_review')}.csv`

        |                   ^^

    383 |       downloadFile('/manage/report/withdraw/', fileName, param)

    384 |     }

    385 |

This error is not related to vue-chart-3

@victorgarciaesgi
Copy link
Owner

@hisuwh Still have the problem?

@hisuwh
Copy link
Author

hisuwh commented Jan 4, 2022

@victorgarciaesgi upgraded to 2.0.3 and yes it seems I still have the same problem:
image

@hisuwh
Copy link
Author

hisuwh commented Feb 3, 2022

@victorgarciaesgi any more guidance on this?

@victorgarciaesgi
Copy link
Owner

I will look at it. It's really strange because the error only shows in the cli on the on the IDE

@victorgarciaesgi
Copy link
Owner

Must be incompatibility issues between Vue 2 proxy and tsx. I it suits you, I can make additional exports like DoughtChartJsx with type any so that the cli don't scream at you. But you will loose auto-completion

@hisuwh
Copy link
Author

hisuwh commented Jun 20, 2022

@victorgarciaesgi this might help - at least I can update for new features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants