Fixed "This method is not implemented: Check that a complete date adapter is provided" error that occurred when loading weather charts. The issue was caused by the Chart.js date adapter trying to register itself before Chart.js was fully loaded in the browser. Updated the vendor.js bundle to ensure proper loading order and added verification logging to confirm all libraries and adapters are loaded correctly. Changes: - Updated import order in vendor.js to ensure Chart.js loads first - Added comments explaining the critical loading order requirements - Added verification logging to check Chart.js adapters are registered 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
No EOL
982 B
JavaScript
29 lines
No EOL
982 B
JavaScript
// Vendor libraries bundle
|
|
// This file loads all external libraries and makes them available globally
|
|
|
|
// IMPORTANT: Order matters! Dependencies must be loaded before their plugins
|
|
|
|
// 1. Load Leaflet first (required by plugins)
|
|
import '../vendor/leaflet.js';
|
|
|
|
// 2. Load Leaflet plugins (they expect window.L to exist)
|
|
import '../vendor/leaflet-heat.js';
|
|
import '../vendor/leaflet.markercluster.js';
|
|
import '../vendor/oms.min.js';
|
|
|
|
// 3. Load Chart.js BEFORE the date adapter
|
|
// The UMD build automatically sets window.Chart
|
|
import '../vendor/chart.umd.js';
|
|
|
|
// 4. Load Chart.js date adapter AFTER Chart.js
|
|
// The adapter needs Chart to be available globally to register itself
|
|
import '../vendor/chartjs-adapter-date-fns.bundle.min.js';
|
|
|
|
// Verify libraries are loaded
|
|
if (typeof window !== 'undefined') {
|
|
console.log('Vendor libraries loaded:', {
|
|
'Leaflet': !!window.L,
|
|
'Chart.js': !!window.Chart,
|
|
'Chart.adapters': !!(window.Chart && window.Chart.adapters)
|
|
});
|
|
} |