The issue might be that Alpine is trying to access the Chart object before it has been fully loaded. One solution could be to use the defer attribute on the script tag that loads the Alpine library. This will ensure that Alpine is loaded after all other scripts have been loaded.
Here's an example of how to modify the script tag in the head section:
<head>
@vite(['resources/js/app.js'])
<script defer src="{{ mix('js/alpine.js') }}"></script>
</head>
If this doesn't solve the issue, another solution could be to use the x-init directive instead of defining a method in the x-data object. This will ensure that the Chart object is fully loaded before it is accessed by Alpine.
Here's an example of how to modify the div in the blade file:
<div x-data="{ }" x-init="init()" class="mt-1 relative">
...
<canvas id="temperatures"></canvas>
</div>