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

Update base.svelte #30

Closed
wants to merge 1 commit into from
Closed

Update base.svelte #30

wants to merge 1 commit into from

Conversation

logvik
Copy link

@logvik logvik commented Feb 15, 2021

I reference on https://frappe.io/charts/docs, because with the initial code, I have been getting this error:

Error: 'Chart' is not exported by node_modules\frappe-charts\dist\frappe-charts.min.cjs.js, imported by node_modules\svelte-frappe-charts\src\components\base.svelte

I reference on https://frappe.io/charts/docs, because with the initial code, I have been getting this error:

Error: 'Chart' is not exported by node_modules\frappe-charts\dist\frappe-charts.min.cjs.js, imported by node_modules\svelte-frappe-charts\src\components\base.svelte
Copy link
Owner

@himynameisdave himynameisdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a known issue with frappe-charts, one that the primary maintainer is trying to fix in v2 of that library.

The easiest way to get around this issue is to configure your bundler to handle mixed CJS/ESM modules. In rollup this can be achieved with the @rollup/plugin-commonjs, specifically by enabling the transformMixedEsModules feature.

Closing this PR for now, but I appreciate you opening it! 👍

import { Chart } from 'frappe-charts/dist/frappe-charts.min.cjs.js';
import { Chart } from 'frappe-charts/dist/frappe-charts.esm.js'
// import css
import 'frappe-charts/dist/frappe-charts.min.css'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unneeded and is not included in the frappe-charts docs.

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 this pull request may close these issues.

2 participants