Skip to content

Fails to resolve package imported from a file in a different directory imported from a config on Node 20.x #590

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

https://stackblitz.com/edit/github-gdzm6nl4?file=setup.js,tsdown.config.ts

Run the following commands on Node 20.x

  1. pnpm i
  2. node setup.js
  3. pnpm build

What is expected?

The build suceeds.

What is actually happening?

The following error happens:

Error: [unrun] Import failed (code length: 222): Cannot find package 'a' imported from /home/projects/github-gdzm6nl4/node_modules/.unrun/tsdown.config.ts.fae6e71f66e86bf1ce5b6898e2a68745.mjs

Any additional comments?

I encountered this in vitejs/vite#21095.
https://github.com/vitejs/vite/actions/runs/19219473498/job/54934596955?pr=21095#step:10:20

I guess this is a bug in unrun. FYI Vite handles this case by rewriting all imports to absolute paths. cc @Gugustinette

Metadata

Metadata

Assignees

No one assigned

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions