Skip to content

[BUG] Parse error gets lost, Error.captureStackTrace is not a function #1

@pblanco-dekalabs

Description

@pblanco-dekalabs

What / Why

The parse method does not return a meaningful error

 Error.captureStackTrace is not a function
    JSONParseError index.js:58
    parseJson index.js:105

When

  • Whenever I try to parse bad JSON.

Where

  • React-CRA app.

How

Current Behavior

  • Parsing throws TypeError: xxx is not a function

Steps to Reproduce

const info = JSON.parse('Bad Json. {"a":0}');

Expected Behavior

  • An error about the parsing problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions