Git Product home page Git Product logo

Comments (19)

TheSisb avatar TheSisb commented on May 5, 2024

import mojs from 'mojs' worked for me

from mojs.

roundrobin avatar roundrobin commented on May 5, 2024

mojs is a different library when loaded via NPM
https://www.npmjs.com/package/mojs

I am doing npm install mo-js --save as describe above which pulls it from: https://www.npmjs.com/package/mo-js

And if I do import mojs from 'mo-js' the mojs object is empty.

how are you loading it?

from mojs.

TheSisb avatar TheSisb commented on May 5, 2024

I didn't test it in-depth, but it returned an object:
npm install mo-js
then
import mojs from 'mojs';

from mojs.

roundrobin avatar roundrobin commented on May 5, 2024

Maybe you have https://www.npmjs.com/package/mojs globally installed.

from mojs.

TheSisb avatar TheSisb commented on May 5, 2024

Looks like I do. Sorry!

from mojs.

legomushroom avatar legomushroom commented on May 5, 2024

@roundrobin hi, sorry about that! I've just rechecked and yes we have the problem with es2015 modules and even with require statements. I've solved the issue but need a drip more tests to ensure it works everywhere. Will try to push the hotfix to the master branch tomorrow.

Thank you so much for heads up and sorry again. Cheers

from mojs.

roundrobin avatar roundrobin commented on May 5, 2024

Awesome @legomushroom That would be amazing. I am happy to test it then #GoEs2015

from mojs.

legomushroom avatar legomushroom commented on May 5, 2024

@roundrobin just released the 0.265.8 version that should fix the issue. Please let me now if doesn't work for you.

from mojs.

roundrobin avatar roundrobin commented on May 5, 2024

Thanks @legomushroom it works for me! Although only with require('mo-js') syntax, when using import statement, it doesnt work.

Thanks for the fast fix 💯

from mojs.

legomushroom avatar legomushroom commented on May 5, 2024

@roundrobin hm it worked for me with import just fine. Could you check this project in the attached archive and confirm if it works for you? Archive.zip

from mojs.

 avatar commented on May 5, 2024

I am occasionally getting "mojs is undefined" errors thrown from helpers with a codepen copied example:

mo.js:5370 Uncaught ReferenceError: mojs is not defined

Helpers.prototype.error = function() {
  if (mojs.isDebug === false) {
    return;
  }
  return console.error.apply(console, this.prepareForLog(arguments));
};

mo.js definitely works with es6 imports, I have it working with mojs.Burst, I've just had the helper mojs reference error thrown in a few instances.

THIS LIBRARY ROCKS! Nice work legomushroom!

from mojs.

legomushroom avatar legomushroom commented on May 5, 2024

@hyperbrave ah that's bad. was rushing to release the fix. You are using the latest release, right?

from mojs.

 avatar commented on May 5, 2024

@legomushroom

"mo-js": "^0.265.8",

The reference error is definitely not always occurring, only a few times. I encountered it initially while trying to copypasta this example. http://codepen.io/sol0mka/pen/pbRejJ

It is thrown always when using an invalid value in burst children options.

new mojs.Burst({
  children: {
     // oops 
    shape: ["triangle"],
  }
})

from mojs.

legomushroom avatar legomushroom commented on May 5, 2024

@hyperbrave thanks! Please use the version 0.265.6 for now, I'll try to fix that asap.

from mojs.

legomushroom avatar legomushroom commented on May 5, 2024

@hyperbrave made 0.265.9 release with the fix, if you use jsdelivr / bower to install the library might need some time to show up on their website. Hope it helps!

from mojs.

 avatar commented on May 5, 2024

@legomushroom thanks! 0.265.9 no mojs reference error thrown by helpers, and a useful log message for invalid shapes!

mo.js:5376 mo·js no "triangle" shape available yet, please choose from this list: ["circle", "line", "zigzag", "rect", "polygon", "cross", "equal", "curve"]

from mojs.

legomushroom avatar legomushroom commented on May 5, 2024

@hyperbrave happy to help! 😊

from mojs.

SuneethaYamani avatar SuneethaYamani commented on May 5, 2024

"mo-js": "^0.288.2" version I am facing same issue

from mojs.

xavierfoucrier avatar xavierfoucrier commented on May 5, 2024

Hi @SuneethaYamani,

You should now use the lastest release from the NPM org.:
import mojs from '@mojs/core'

Check the official documentation at https://mojs.github.io/tutorials/getting-started.html#setup-mo-js-in-your-project.

😉

from mojs.

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.