You will get an error in your console if you use something that is not imported. If you want to be sure you just have everything and throw away the benefit of tree-shaking you can use this import and register:
import { Chart, registerables } from 'chart.js'
Chart.register(...registerables)
Or in one line:
import Chart from 'chart.js/auto'
For the example to work, the elements that need to be imported and registered are:
barController
barElement
categoryScale
Tooltip
Legend
Generally speaking for a chart you need its controller so lineController for line chart, pieController for a pie chart, etc.
You need the element so a lineElement and pointElement for line or radar chart, arcElement for pie, doughnut or polar area chart, and barElement for bar chart.
And then you need to import the supplied plugins for the title, filler (for area charts), legend, and the tooltip.