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

Cannot read property 'isPromise' of undefined #49

Closed
Borewit opened this issue Nov 8, 2019 · 5 comments
Closed

Cannot read property 'isPromise' of undefined #49

Borewit opened this issue Nov 8, 2019 · 5 comments

Comments

@Borewit
Copy link

Borewit commented Nov 8, 2019

Issue

I got experience the following issue with [email protected]

Uncaught TypeError: Cannot read property 'isPromise' of undefined
    at Object../node_modules/assert/build/assert.js (assert.js:42)

Workaround

Downgrade to [email protected]

Ref

My issue: Borewit/audio-tag-analyzer#97

@goto-bus-stop
Copy link
Member

assert@2 depends on [email protected], which has an isPromise function. maybe webpack is preferring its own version of util over the one we depend on?

@Borewit
Copy link
Author

Borewit commented Nov 9, 2019

Thank you for your reply @goto-bus-stop.

The issue is indeed caused by a combination of [email protected] & [email protected].

node-libs-browser depends on:

@Borewit
Copy link
Author

Borewit commented Nov 9, 2019

Instead of downgrading, using yarn, you may add the following to your package.json

"resolutions": {
      "**/util": "^0.12.0"
  }

@Borewit Borewit closed this as completed Nov 9, 2019
@goto-bus-stop
Copy link
Member

Good to hear you figured out a workaround! We do require('util/') which makes browserify pick the version we depend on instead of the one browserify bundles, wonder if we can do another trick to make webpack do the same…

(FWIW, node-libs-browser is pretty much unmaintained. With webpack@5, you'll be expected to manually install shims for Node.js core modules, so they're not investing time in keeping that stuff up to date.)

@Borewit
Copy link
Author

Borewit commented Nov 12, 2019

wonder if we can do another trick to make webpack do the same

By explicitly requiring util WebPack takes the dependency into account and may respect the util dependency version right?

node-libs-browser is pretty much unmaintained

I know, most likely the PR will not be accepted, but I documented the solution for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants