jquery.nicescroll icon indicating copy to clipboard operation
jquery.nicescroll copied to clipboard

niceScroll with requirejs

Open IvanSivak opened this issue 5 years ago • 0 comments

Hi there,

Just encountered this bug:

Mismatched anonymous define() modules

..when using the niceScroll with requirejs. According to requirejs site: https://requirejs.org/docs/errors.html#mismatch this can happen when e.g.:

If you use the loader plugins or anonymous modules (modules that call define() with no string ID) but do not use the RequireJS optimizer to combine files together, this error can occur.

So I changed this line from the beginning of the niceScroll plugin:

define(['jquery'], factory);

into:

define('niceScrollModule', ["jquery"], factory)

..and problem disappeared. Seems to be fixed. But can you please check if it's ok and if my fix won't destroy anything else? I'm sorry for not having code to reproduce. This has been a hot fix for me. Thanks

IvanSivak avatar Aug 07 '19 16:08 IvanSivak