bs5-utils
bs5-utils copied to clipboard
Error in browser
I use bs5-utils with the dist/js in a script tag
With the last version i have some problem with other library...
this error popup loading a library after bs5-utils: module is not defined
With the previous version no problem. I can also fix this error putting bs5 tag last
@mila76
Can you please provide a reproduciable example because I've got it working without any issues here using the latest version: https://jsfiddle.net/cr0dez8q/
https://jsfiddle.net/o37kyac2/
pasted another library (tingle js) You can see the error in browser console
I think the problem is exports = {} in your library (webpack doing i assume)
Same issue when mixing this e.g. with nprogress.
It is fairly common to see code like this:
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.NProgress = factory();
}
The presense of exports object, unfortunately, confuses it.
In this instance I could just reverse the order in which scripts are loaded, but regardless, cluttering the global exports var is definitely not a good thing.
Same issue when including dist/js in a script tag along with with Pace.js https://github.com/CodeByZach/pace/issues/541