aprs.me/assets/js
Graham McIntire 493805706f
Fix Chart.js adapter dynamic require error with CommonJS shim
Fixed "Dynamic require of 'chart.js' is not supported" error that occurred
when the Chart.js date adapter tried to use require() in the browser.

The issue was caused by marking chart.js as external in esbuild, which
prevented the bundler from resolving the require() call. The date adapter
uses UMD format and expects to find Chart.js via require() in CommonJS
environments.

Solution:
- Added a temporary window.require shim before loading the date adapter
- The shim returns window.Chart when require('chart.js') is called
- Cleaned up the shim after the adapter loads to avoid polluting globals
- This allows the adapter to find Chart.js and register itself properly

The weather charts now load without errors in both development and production.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 10:21:32 -05:00
..
features Fix trail lines not connecting historical positions 2025-07-21 08:31:16 -05:00
hooks cleanup 2025-07-18 14:44:52 -05:00
types Fix JavaScript error when navigating from map to weather page 2025-07-20 08:19:51 -05:00
app.js Use Sentry Loader script to handle CORS errors gracefully 2025-07-18 15:51:21 -05:00
map.ts Fix trail lines not connecting historical positions 2025-07-21 08:31:16 -05:00
map_fixes.ts Remove debug console.log statements from JavaScript files 2025-07-18 15:37:05 -05:00
map_helpers.ts Improve type safety for getTrailId function 2025-07-21 08:36:38 -05:00
topbar.js js tweak 2025-07-05 13:16:37 -05:00
vendor.js Fix Chart.js adapter dynamic require error with CommonJS shim 2025-07-21 10:21:32 -05:00