Skip to content

ParseError doesn't have pos field #17095

@verytactical

Description

@verytactical

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

// foo.ts
import { parse } from '@babel/parser';
const result = parse(code, {
    sourceType: "module",
    plugins: ["typescript"],
    errorRecovery: true,
})
result.errors[0].pos; // no such field

Configuration file name

No response

Configuration

{
    "sourceType": "module",
    "plugins": ["typescript"],
    "errorRecovery": true,
}

Current and expected behavior

No field "pos"

Environment

  • Babel version: 7.26.7
  • Node: v22.11.0

Possible solution

Make type up to date with implementation

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions