fix crawling issue
This commit is contained in:
parent
dfc9bb2ac5
commit
9e6e8c069d
2 changed files with 3 additions and 4 deletions
|
@ -2,7 +2,6 @@
|
|||
import * as ToggleGroup from '$lib/components/ui/toggle-group';
|
||||
import Tooltip from '$lib/components/Tooltip.svelte';
|
||||
import Chart from 'chart.js/auto';
|
||||
import zoomPlugin from 'chartjs-plugin-zoom';
|
||||
import mapboxgl from 'mapbox-gl';
|
||||
import { map } from '$lib/stores';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
|
@ -69,7 +68,6 @@
|
|||
let overlay: HTMLCanvasElement;
|
||||
let chart: Chart;
|
||||
|
||||
Chart.register(zoomPlugin);
|
||||
Chart.defaults.font.family =
|
||||
'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'; // Tailwind CSS font
|
||||
|
||||
|
@ -294,7 +292,9 @@
|
|||
}
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
onMount(async () => {
|
||||
Chart.register((await import('chartjs-plugin-zoom')).default); // dynamic import to avoid SSR and 'window is not defined' error
|
||||
|
||||
chart = new Chart(canvas, {
|
||||
type: 'line',
|
||||
data: {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
export const prerender = true;
|
||||
export const ssr = false;
|
||||
|
||||
import { languages } from '$lib/languages';
|
||||
import { register, init } from 'svelte-i18n';
|
||||
|
|
Loading…
Reference in a new issue