Skip to content

Incorrect output when using Vanilla-extract #136

@etienne-dldc

Description

@etienne-dldc

Describe the bug

When using vanilla-extract the generated output is missing types from .css.ts.

This is caused by this condition excluding any import ending by .css.

Workaround:
I found 2 workaround:

  1. Patch the lib to remove the condition (this works because I don't have any CSS import)
  2. Add .js when importing/exporting from .css.ts files (but it's easy to miss one...).

Reproduction

https://github.com/etienne-sandbox/tsdown-vanilla-extract-issue

System Info

System:
    OS: macOS 15.7.2
    CPU: (12) arm64 Apple M2 Pro
    Memory: 117.47 MB / 16.00 GB
    Shell: 4.0.8 - /opt/homebrew/bin/fish
  Binaries:
    Node: 24.9.0 - /Users/etienne/.local/state/fnm_multishells/82939_1763309296783/bin/node
    npm: 11.6.0 - /Users/etienne/.local/state/fnm_multishells/82939_1763309296783/bin/npm
    pnpm: 10.22.0 - /Users/etienne/.local/state/fnm_multishells/82939_1763309296783/bin/pnpm
    Deno: 2.5.6 - /Users/etienne/.deno/bin/deno
  Browsers:
    Brave Browser: 120.1.61.104
    Chrome: 142.0.7444.162
    Firefox: 131.0.3
    Safari: 26.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions