Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in browser #7

Open
mila76 opened this issue Jan 15, 2022 · 4 comments
Open

Error in browser #7

mila76 opened this issue Jan 15, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@mila76
Copy link

mila76 commented Jan 15, 2022

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

@Script47
Copy link
Owner

Script47 commented Jan 16, 2022

@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/

@Script47 Script47 added bug Something isn't working wontfix This will not be worked on and removed bug Something isn't working wontfix This will not be worked on labels Jan 16, 2022
@mila76
Copy link
Author

mila76 commented Jan 16, 2022

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)

@nirvana-msu
Copy link

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.

@btraas
Copy link

btraas commented Nov 4, 2022

Same issue when including dist/js in a script tag along with with Pace.js
CodeByZach/pace#541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants