Skip to content

getMetaDataSymbol() declares a boxed Symbol #890

Open

Description

@eugeniodepalo
  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool? Not applicable to TypeScript declarations.
  • Have you checked the docs for helpful APIs and examples?

Description

The ESM and CommonJS declarations return boxed Symbol from XMLParser.getMetaDataSymbol(), preventing direct use as a property key. The implementation returns a primitive symbol, with an existing string fallback.

Input

fast-xml-parser 5.11.2, TypeScript 5.9.3. Save as repro.mts and run npx tsc --strict --noEmit --module nodenext repro.mts.

Code

import { XMLParser } from "fast-xml-parser";

const key: PropertyKey = XMLParser.getMetaDataSymbol();

Output

error TS2322: Type 'Symbol' is not assignable to type 'PropertyKey'.

expected data

The assignment should compile. I have a declaration-only fix returning symbol | string, with ESM and CommonJS consumer tests.

Would you like to work on this issue?

  • Yes
  • No

Activity

  1. github-actions commented on Oct 13, 2026

    @github-actions

    We're glad you find this project helpful. We'll try to address this issue ASAP. You can join Discord channel(https://discord.gg/X4Qp9u6Vz) for anonucements and pre release discussions. Don't forget to star this repo.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions