-
Notifications
You must be signed in to change notification settings - Fork 105
Description
Environment
pnpm 9.15.1
npm 10.8.2
node 22.6.0
Windows 10 PRO
Reproduction
https://github.com/userquin/unbuild-cts-issue
Describe the bug
When using default exports with additional exports d.cts
file with wrong default export.
This PR #458 doesn't fix d.ts
files and it should.
Additional context
I'm updating unbuild to 3.2.0 in UnoCSS repo, and dts files for node10 and node16 CJS are wrong (we have ESM only and ESM first with dual CJS/ESM packages).
Logs
unbuild-cts-issue@1.0.0 test:attw D:\work\issues\unbuild-cts-issue
attw --pack
unbuild-cts-issue v1.0.0
Build tools:
- @arethetypeswrong/cli@^0.17.2
- typescript@^5.7.2
❗️ The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime. These types should use export = instead of export default. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md
┌───────────────────┬──────────────────────────────┐ │ │ "unbuild-cts-issue" │ ├───────────────────┼──────────────────────────────┤ │ node10 │ ❗️ Incorrect default export │ ├───────────────────┼──────────────────────────────┤ │ node16 (from CJS) │ ❗️ Incorrect default export │ ├───────────────────┼──────────────────────────────┤ │ node16 (from ESM) │ 🟢 (ESM) │ ├───────────────────┼──────────────────────────────┤ │ bundler │ 🟢 │ └───────────────────┴──────────────────────────────┘
ELIFECYCLE Command failed with exit code 1.