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

lib throws error with "Cannot read property 'isNative' of undefined" #288

Open
dottgonzo opened this issue Apr 29, 2021 · 2 comments
Open

Comments

@dottgonzo
Copy link

For seemingly unknown causes, when running transpiled code (either through ts-node, or running the plain javascript after transpiling it with tsc) the code throws the error "Cannot read property 'isNative' of undefined."

The piece of code that looks to be the problem is inside source-map-support, as follows:

if (frame.isNative()) // Here sometimes "frame" is undefined
@dottgonzo dottgonzo changed the title lib throws error with "isNative of undefined" lib throws error with "Cannot read property 'isNative' of undefined" Apr 29, 2021
@csjiang
Copy link

csjiang commented Feb 21, 2022

We're getting this issue too running node v14.17.6 and the following versions for source-maps:

    "source-map": {
      "version": "0.6.1",
      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
      "dev": true
    },
    "source-map-support": {
      "version": "0.5.19",
      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
      "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
      "dev": true,
      "requires": {
        "buffer-from": "^1.0.0",
        "source-map": "^0.6.0"
      }
    },
    ```

@craig552uk
Copy link

I have also ran into this. I'm unsure exactly what causes it but found that some combination of using Bunyan logger in a promise chain caused the issue.

I found that changing this:
myPromise().catch(logger.error)

to this:
myPromise().catch(err => logger.error(err))

stopped the issue.

I hope this helps someone.

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