Skip to content

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

Open

Description

@dottgonzo

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

Activity

  1. changed the title [-]lib throws error with "isNative of undefined"[/-] [+]lib throws error with "Cannot read property 'isNative' of undefined"[/+] on Apr 29, 2021
  2. csjiang commented on Feb 21, 2022

    @csjiang

    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"
          }
        },
        ```
    
  3. craig552uk commented on Aug 23, 2023

    @craig552uk

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions