Skip to content

Config file loading fails with Yarn PnP (ERR_INVALID_RETURN_PROPERTY_VALUE) #639

@OrlovAlexei

Description

@OrlovAlexei

Reproduction link or steps

https://github.com/OrlovAlexei/tsdown-pnp-bug-repro

git clone https://github.com/OrlovAlexei/tsdown-pnp-bug-repro
cd tsdown-pnp-bug-repro
yarn install
yarn build

What is expected?

Build succeeds and outputs files to dist/

What is actually happening?

ℹ tsdown v0.17.2 powered by rolldown v1.0.0-beta.53
ERROR TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected a string, an ArrayBuffer, or a TypedArray to be returned for the "source" from the "load" hook but got undefined.

Any additional comments?

  • Happens with all config file formats: .ts, .js, .mjs, .cjs
  • Environment: Node.js 22.x, Yarn 4.x with PnP mode
  • Workaround: remove config file and use CLI args instead (yarn tsdown src/index.ts --format esm)
  • The issue appears to be in the native config loader when used with Yarn PnP's ESM hooks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions