Skip to content

Error stacks in log includes null.thing instead of just thing #42417

@fabiancook

Description

@fabiancook

Version

v17.4.0

Platform

Darwin Mac-mini.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64

Subsystem

No response

What steps will reproduce the bug?

git clone git@github.com:virtualstate/focus.git
cd focus
git checkout 07998653ea604a44e15d31e66fa4e3e6c72c06be
yarn
yarn test

You will see the last log being:

  [
    { value: [Object], status: 'fulfilled' },
    {
      reason: /Users/fabiancook/src/virtualstate/focus/src/tests/throw.tsx:5
          throw new Error();
                ^
      
      Error
          at null.Throw1 (/Users/fabiancook/src/virtualstate/focus/src/tests/throw.tsx:5:11)
          at Object.[Symbol.asyncIterator] (/Users/fabiancook/src/virtualstate/focus/src/component.ts:32:22)
          at AsyncGenerator.next (<anonymous>)
          at null.childrenSettledGeneratorInner (/Users/fabiancook/src/virtualstate/focus/src/children.ts:135:24)
          at childrenSettledGeneratorInner.next (<anonymous>)
          at null.childrenSettledGeneratorInner (/Users/fabiancook/src/virtualstate/focus/src/children.ts:131:14)
          at childrenSettledGeneratorInner.next (<anonymous>)
          at null.childrenSettledGenerator (/Users/fabiancook/src/virtualstate/focus/src/children.ts:112:22)
          at childrenSettledGenerator.next (<anonymous>)
          at null.<anonymous> (/Users/fabiancook/src/virtualstate/focus/src/children.ts:187:28),
      status: 'rejected'
    }
  ]
]

or the smaller case:

try {
    async function Throw1() {
        throw new Error();
    }
    await Throw1();
} catch (error) {
    console.error(error)
}

Logs

Error
    at null.Throw1 (/Users/fabiancook/src/virtualstate/fringe/src/tests/throw.tsx:5:11)
    at null.<anonymous> (/Users/fabiancook/src/virtualstate/fringe/src/tests/throw.tsx:59:11)

If I run this same code with deno, I do not see null

yarn test:deno
  [
    {
      value: { source: "child1", options: [Object], children: [Object] },
      status: "fulfilled"
    },
    {
      reason: Error
    at Throw1 (file:///Users/fabiancook/src/virtualstate/fringe/esnext/tests/throw.js:4:11)
    at Object.[Symbol.asyncIterator] (file:///Users/fabiancook/src/virtualstate/fringe/esnext/component.js:25:28)
    at AsyncGenerator.next (<anonymous>)
    at childrenSettledGeneratorInner (file:///Users/fabiancook/src/virtualstate/fringe/esnext/children.js:62:30)
    at childrenSettledGeneratorInner.next (<anonymous>)
    at childrenSettledGeneratorInner (file:///Users/fabiancook/src/virtualstate/fringe/esnext/children.js:56:20)
    at childrenSettledGeneratorInner.next (<anonymous>)
    at childrenSettledGenerator (file:///Users/fabiancook/src/virtualstate/fringe/esnext/children.js:43:26)
    at childrenSettledGenerator.next (<anonymous>)
    at file:///Users/fabiancook/src/virtualstate/fringe/esnext/children.js:94:34,
      status: "rejected"
    }
  ]
]
Error
    at Throw1 (file:///Users/fabiancook/src/virtualstate/fringe/esnext/tests/throw.js:53:15)
    at file:///Users/fabiancook/src/virtualstate/fringe/esnext/tests/throw.js:55:11

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

null does not show

What do you see instead?

null shows

Additional information

I'm reporting this because I expect showing null is not intentional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions