Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Vue3 #25

Open
tedik123 opened this issue May 9, 2023 · 4 comments
Open

Error with Vue3 #25

tedik123 opened this issue May 9, 2023 · 4 comments

Comments

@tedik123
Copy link

tedik123 commented May 9, 2023

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>
@lllianreg
Copy link

+1 vite下的

@n-osennij
Copy link

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)

@iamcarlos94
Copy link

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

@kirillshatalkin
Copy link

Changing vite config fixed issue

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants