Skip to content

fix(pkg): fix duplicate configuration warning logic#935

Merged
sxzz merged 2 commits intorolldown:mainfrom
ho991217:fix/dupped-config
May 3, 2026
Merged

fix(pkg): fix duplicate configuration warning logic#935
sxzz merged 2 commits intorolldown:mainfrom
ho991217:fix/dupped-config

Conversation

@ho991217
Copy link
Copy Markdown
Contributor

@ho991217 ho991217 commented May 3, 2026

  • This PR contains AI-generated code, but I have carefully reviewed it myself. Otherwise, my PR may be closed.

Description

bundleDone() crashes with TypeError: Cannot read properties of undefined (reading 'logger') when only one of publishConfigs / attwConfigs has length > 1. Falls back to whichever side actually has the duplicate so the warning can be emitted safely.

dedupeConfigs(configs, 'publint') collapses to length 1 because publint: true is filtered out and falls through to [filtered[0]].
However, dedupeConfigs(configs, 'attw') keeps length 2 because each entry's attw is a fresh literal and dedupe is reference-based. The OR-guarded warning then derefereces publintConfig[1] and throws

Repro

import { defineConfig } from 'tsdown';

export default defineConfig([
  { entry: "./a.ts", publint: true, attw: { profile: 'esm-only' } },
  { entry: "./b.ts", publint: true, attw: { profile: 'esm-only' } },
]);

Linked Issues

Additional context

Copilot AI review requested due to automatic review settings May 3, 2026 06:12
@netlify
Copy link
Copy Markdown

netlify Bot commented May 3, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 8871403
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/69f6f46c6f9a1200082a8357
😎 Deploy Preview https://deploy-preview-935--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 3, 2026

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/tsdown@935 -D
npm i https://pkg.pr.new/tsdown@935 -D
yarn add https://pkg.pr.new/tsdown@935.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/create-tsdown@935 -D
npm i https://pkg.pr.new/create-tsdown@935 -D
yarn add https://pkg.pr.new/create-tsdown@935.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/@tsdown/css@935 -D
npm i https://pkg.pr.new/@tsdown/css@935 -D
yarn add https://pkg.pr.new/@tsdown/css@935.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/@tsdown/exe@935 -D
npm i https://pkg.pr.new/@tsdown/exe@935 -D
yarn add https://pkg.pr.new/@tsdown/exe@935.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/tsdown-migrate@935 -D
npm i https://pkg.pr.new/tsdown-migrate@935 -D
yarn add https://pkg.pr.new/tsdown-migrate@935.tgz -D

commit: 8871403

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a crash in the package bundling completion flow when duplicate configuration warnings are emitted and only one of publint/attw has multiple configs for a package.

Changes:

  • Adjust duplicate config warning logic to select an available duplicate config (publint or attw) before logging.
  • Prevent TypeError: Cannot read properties of undefined (reading 'logger') in bundleDone() when only one side has duplicates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sxzz sxzz changed the title fix(pkg): fix duplicate configuration warning logic. fix(pkg): fix duplicate configuration warning logic May 3, 2026
@sxzz sxzz merged commit 6a0d98c into rolldown:main May 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants