DEV Community

Discussion on: Using Vite with React

Collapse
 
blessinghirwa profile image
Blessing Hirwa

I'm using vite,typescript ,react and chart.js but still getting a problem.

import { Pie, defaults } from "react-chartjs-2";

defaults.global.tooltips.enabled = false;
defaults.global.legend.position = "bottom";
Enter fullscreen mode Exit fullscreen mode

After doing that I'm getting this error:
Property 'global' does not exist on type 'Defaults'.ts(2339)
any

Collapse
 
nirtamir2 profile image
nirtamir2

It seems like a TypeScript compile error (not a runtime).
This is not related to vite, because it does not check types.
See stackoverflow.com/questions/407431... for possible solution.