Code Monkey home page Code Monkey logo

Comments (4)

oshihirii avatar oshihirii commented on May 23, 2024

Update, I get the same error using the latest version of the files too, ie:

https://github.com/One-com/one-color/blob/master/one-color.js

https://github.com/bebraw/colorjoe/blob/master/dist/colorjoe.js

ERROR in ./src/js/colorjoe.js
Module not found: Error: Can't resolve 'ONECOLOR' in 'C:\Users\Me\Documents\my_repo\src\js'
@ ./src/js/colorjoe.js 9:8-11:10

So I tried using the following src files instead of the dist file:

https://github.com/bebraw/colorjoe/blob/master/src/colorjoe.js
https://github.com/bebraw/colorjoe/blob/master/src/extras.js
https://github.com/bebraw/colorjoe/blob/master/src/utils.js

Import statements are now:

import one from './one-color';
import extras from './extras';
import utils from './utils';
import colorjoe from './colorjoe';

And now I get error on frontend in chrome dev tools:

Uncaught ReferenceError: extras is not defined at eval (webpack:///./src/js/colorjoe.js?:75)

Relevant code there is:

for (var k in extras) {
    colorjoe.registerExtra(k, extras[k]);
}

https://github.com/bebraw/colorjoe/blob/master/src/colorjoe.js#L73

from colorjoe.

oshihirii avatar oshihirii commented on May 23, 2024

I'm not sure if this is the issue as I know very little about webpack...

I saw in the above code snippet, extras hadn't been defined, so I just copied all content from the extras file and pasted it at the top of the colorjoe file (in https://github.com/bebraw/colorjoe/tree/master/src).

The error went away, but I'm still not sure if colorjoe will work as I am still troubleshooting other issues.

from colorjoe.

oshihirii avatar oshihirii commented on May 23, 2024

Now I get errors like:

Uncaught TypeError: _colorjoe2.default.hsl is not a function

triggered by the webpack generated code:

global.joe = _colorjoe2.default.hsl('hslPicker', color, ['currentColor', ['fields', { space: 'RGB', limit: 255, fix: 2 }]]);

which is like this in the source:

global.joe = colorjoe.hsl('hslPicker', color, ['currentColor', ['fields', { space: 'RGB', limit: 255, fix: 2 }]]);

from colorjoe.

bebraw avatar bebraw commented on May 23, 2024

Hi,

I repackaged the whole thing. You should be able to consume it from npm directly now. It comes with the extras too although the API can likely be improved further.

from colorjoe.

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.