Coder Social home page Coder Social logo

Comments (4)

RP421 avatar RP421 commented on May 11, 2024

I am also seeing this same behavior after upgrading from 1.5.0 to 1.7.0.

from svelte-frappe-charts.

himynameisdave avatar himynameisdave commented on May 11, 2024

TLDR; This issue can be resolved with your bundler (by explicitly not setting the browser version of frappe-charts). I'm unsure about how to do this in every bundler, but in rollup this involves setting browser: false in @rollup/plugin-node-resolve.

The real issue here is because of how the core frappe-charts library is doing its iife bundle. It never exports a Chart constructor, meaning your bundler can't even convert it to ESM/CJS and import it properly.

I am sorry that you are running into this issue. I am open to suggestions about ways we can mitigate this in this library, but this really needs to be dealt with upstream. We are still waiting on this issue, so please go comment over there that this needs to be fixed (or suggest a better way we can handle this here).

from svelte-frappe-charts.

jycouet avatar jycouet commented on May 11, 2024

Thank you for the info @himynameisdave.
Unfortunatly, I can't turn browser: false on my side.

Looking forward to your PR frappe/charts#336

from svelte-frappe-charts.

himynameisdave avatar himynameisdave commented on May 11, 2024

Yeah sorry that you're running into this @jycouet. 😢 I'm hoping that fix gets approved + merged upstream so that we can cut a release here soon. In the meantime, you might want to try [email protected]. It's functionally equivalent to 1.7.0 (current as of writing), but imports the cjs import which should work for you. Again, sorry for the headaches.

Another idea (I personally haven't tested this), but I believe there is a way in the @rollup/plugin-node-resolve to specify how to resolve specific packages, meaning you could set browser: true for everything, and then specify browser: false specifically for svelte-frappe-charts. Again, not sure this is worth it, but it might take awhile for it to be merged upstream so might be worth looking into.

Again, sorry for the headaches.

from svelte-frappe-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.