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

Loading fails with TypeError in Firefox #1158

Closed
andrenarchy opened this issue May 16, 2016 · 8 comments
Closed

Loading fails with TypeError in Firefox #1158

andrenarchy opened this issue May 16, 2016 · 8 comments
Labels

Comments

@andrenarchy
Copy link

Loading async 2.0.0-rc.4 in Firefox (tested with 38 and 42) via

<!doctype html>

<html>
  <body>
    <script src="node_modules/async/dist/async.js"></script>
  </body>
</html>

fails with the following error:

TypeError: Function.prototype.toString called on incompatible object (async.js:1425:31)

This is the corresponding line.

@megawac
Copy link
Collaborator

megawac commented May 16, 2016

/cc @jdalton

@jdalton
Copy link
Contributor

jdalton commented May 16, 2016

This has been fixed since lodash v4.8.0 (current stable is v4.12.0)
Make sure y'all build with a fresh npm i of lodash.

@andrenarchy
Copy link
Author

Oh, dist/async.js includes lodash functions? These functions seem to be outdated. Can someone please update them for providing a quick solution to the problem?

@megawac
Copy link
Collaborator

megawac commented May 16, 2016

@aearly can you update the npm dist build

@andrenarchy
Copy link
Author

Thanks a lot! 👍

I wonder why the npm version also uses dist/async.js and thus does not benefit from updates to the dependencies in package.json (shouldn't they be devDependencies at the moment?). Instead, you always need to update async when lodash pushes an update – and we all know how busy @jdalton is with getting new updates out! :) Do you have any references where this decision is explained?

@megawac
Copy link
Collaborator

megawac commented May 16, 2016

The discussion is kinda scattered through #996. The main reason is to minimize import time so npm doesn't have to load so many files. The reason it's a dependency still is so you can import specific methods (require('async/each')) and have it look up the dependent lodash methods properly.

@andrenarchy
Copy link
Author

I'll look into the referenced issue, thanks!

@megawac
Copy link
Collaborator

megawac commented May 16, 2016

@andrenarchy search for main and you should be able to jump through the relevant discussion (core of it #996 (comment))

@megawac megawac added the bug label May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants