Coder Social home page Coder Social logo

Comments (7)

MintyMods avatar MintyMods commented on April 28, 2024 1

I believe I can fix this by simply renaming roughviz.min.js to index.js?

Sorry I initially raised this without doing much investigation hence my follow up with issue #8

I have not done any npm packaging as yet and I am certainly no expert but renaming roughviz.min.js to index.js does indeed resolve the issue for me.

You would need to confirm this resolves the issue for you as the contents of the original index.js looks build related so double check nothing wipes out your change following a build :)

from roughviz.

thisconnect avatar thisconnect commented on April 28, 2024 1

The file rough-viz.min.js is commited and checked into git
https://github.com/jwilber/roughViz/blob/master/dist/rough-viz.min.js

It looks like your build script (parcel) creates
an UMD (for browsers)
and a nodejs/commonjs version (that it can be require'd)
https://github.com/jwilber/roughViz/blob/master/package.json#L7-L10

parcel creates roughviz.min.js (without the dash -) and index.js (I think), but non of them create rough-viz.min.js

fyi you should consider having a module field that points directly to the source, so people can import es modules directly.

can you double check that the file dist/rough-viz.min.js isn't generated

from roughviz.

vcheeze avatar vcheeze commented on April 28, 2024 1

Nevermind this seems to be an issue with svelte-kit. Tried with Sapper (predecessor of svelte-kit), and it works. Thanks!

from roughviz.

jwilber avatar jwilber commented on April 28, 2024

Thanks!

I believe I can fix this by simply renaming roughviz.min.js to index.js? If not do you know a correct solution? I don't do too much front-end stuff so the npm stuff can be a bit of a hassle at times!

from roughviz.

vcheeze avatar vcheeze commented on April 28, 2024

@MintyMods it's been a while since your comment, but I've tried renaming rough-viz.min.js as well as roughViz.min.js (both are still generated) to index.js, but I am consistently getting the error you mentioned in #8

Uncaught TypeError: Cannot read property 'ownerDocument' of null

Have you worked with this recently and have any idea how I might resolve this? It might be worth mentioning that I am using svelte-kit, which is still in beta phase.

from roughviz.

MintyMods avatar MintyMods commented on April 28, 2024

Hi @vcheeze,

To be honest I kinda put my project on hold to allow Svelte to mature a little more while I worked on something else but I do love the concept of Svelte and have been meaning to get back into my project with hopefully a little more time to investigate and contribute to some of the issues that I originally hit.

I was literally typing to offer help but just seen your update ;o)

Glad you resolved the issue my friend.

from roughviz.

jwilber avatar jwilber commented on April 28, 2024

Cleaned this up (years later 🐌 ) with V2.
Can import ESM via import roughViz from "rough-viz";

from roughviz.

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.