jscharting-vue icon indicating copy to clipboard operation
jscharting-vue copied to clipboard

Error with Vue3

Open tedik123 opened this issue 2 years ago • 4 comments

I copied and pasted the example in the vue3 documentation and I keep getting: Uncaught SyntaxError: The requested module '/node_modules/jscharting/dist/jscharting.js?v=c78523e5' does not provide an export named 'Chart' (at jscharting.vue:6:10)

<template>
    <JSCharting :options="chartOptions" ></JSCharting>
</template>

<script lang="ts">
import { defineComponent, reactive } from 'vue'
import JSCharting, { JSC } from 'jscharting-vue';

export default defineComponent({
   name: 'columnChart',
   setup() {
      const chartOptions = reactive({
         type: 'horizontal column',
         series: [
            {
               points: [
                  { x: 'A', y: 50 },
                  { x: 'B', y: 30 },
                  { x: 'C', y: 50 }
                  ]
              }
          ]
        } as JSC.JSCChartConfig);
      return { chartOptions }; 
    },
    components: {
        JSCharting
    }
});
</script>

tedik123 avatar May 09 '23 18:05 tedik123

+1 vite下的

lllianreg avatar Jul 24 '23 10:07 lllianreg

Uncaught SyntaxError: The requested module '/node_modules/jscharting/dist/jscharting.js?v=296b01d1' does not provide an export named 'Chart' (at jscharting.vue:6:10)

n-osennij avatar Aug 31 '23 10:08 n-osennij

Uncaught SyntaxError: ambiguous indirect export: Chart [jscharting.vue:2:10](http://0.0.0.0:5173/node_modules/jscharting-vue/src/components/jscharting.vue)

iamcarlos94 avatar Oct 10 '23 16:10 iamcarlos94

Changing vite config fixed issue

export default defineConfig({
    // ...
    optimizeDeps: {
        include: ['jscharting'],
    },
})

kirillshatalkin avatar Jan 08 '24 14:01 kirillshatalkin