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

m.has is not a function #5

Open
dph01 opened this issue Aug 2, 2019 · 2 comments
Open

m.has is not a function #5

dph01 opened this issue Aug 2, 2019 · 2 comments

Comments

@dph01
Copy link

dph01 commented Aug 2, 2019

Hi, Thanks for putting the code out there, it's just what I'm looking for.

When I run a minified production build of my code I'm getting an error message in TraceError code:

m.has is not a function TypeError: m.has is not a function

this occurs at:

    key: "_defineProperty",
    value: function(e, t) {
        var a = m.has(this) ? m.get(this) : {};
        a[e] = t,
        m.set(this, a)
      } 

Is this a known error? Any work-arounds?
Thanks.

@mathew-kurian
Copy link
Owner

TraceError uses Weakmaps which is not available in your environment. I would suggest a polyfill.

@leops
Copy link

leops commented Mar 4, 2021

I've hit this error the other way around: this library is using the weakmap package to polyfill the WeakMap builtin, but the polyfill declares the prototype of the WeakMap class in a way that minifiers like Uglify or Terser can't understand, so either the name of the methods get mangled or the methods are removed altogether. Seeing as WeakMap has been supported by all major platforms for a few years by now, I'd suggest either doing away with the polyfill (that would also close #6 I suppose) or only loading it if it's actually needed.

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

3 participants