Skip to content

v0.21.0 Breaks Vue + CSS #800

Closed
Closed

Description

@methompson

Reproduction link or steps

Project with issue can be found here:
https://github.com/methompson/tsdown_issue_example

This project did the following:

  1. Per the instructions on the tsdown page , create a Vue + Tsdown project: npm install -D @tsdown/css
  2. All dependencies were installed with npm i
  3. Once all dependencies are added, tsdown was updated to the latest: npm i tsdown@latest
  4. Styles were added to MyButton.vue

Reproduction steps:

  1. Clone project
  2. Run npm ci to install dependencies from package-lock.json
  3. Run npm run build to attempt to build the project

What is expected?

The project to build (v 0.18 builds fine)

What is actually happening?

An error is thrown causing a build failure:

> [email protected] build
> tsdown

ℹ tsdown v0.21.0 powered by rolldown v1.0.0-rc.7
ℹ config file: /Users/work/Desktop/work/tsdown_issue_example/tsdown.config.ts 
ℹ entry: src/index.ts
ℹ tsconfig: tsconfig.json
ℹ Using Vite config: /Users/work/Desktop/work/tsdown_issue_example/vite.config.ts
ℹ Build start

 ERROR  Error: Build failed with 1 error:

[plugin tsdown:builtin-css]
Error: ENOENT: no such file or directory, open '/Users/work/Desktop/work/tsdown_issue_example/src/MyButton.vue?vue&type=style&index=0&lang.css'
    at async open (node:internal/fs/promises:637:25)
    at async readFile (node:internal/fs/promises:1269:14)
    at async LoadPluginContextImpl.handler (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/plugin-BQv869Ce.mjs:105:16)
    at async plugin (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/bindingify-input-options-u9u3KSja.mjs:1132:16)
    at async plugin.<computed> (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/bindingify-input-options-u9u3KSja.mjs:1562:12)
    at aggregateBindingErrorsIntoJsError (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/error-FTNambir.mjs:48:18)
    at unwrapBindingResult (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/error-FTNambir.mjs:18:128)
    at #build (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/rolldown-build-DQKLqVyb.mjs:3308:34)
    at async build (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/index.mjs:46:22)
    at async Promise.all (index 0)
    at async buildSingle (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/build-TmLngPCw.mjs:735:19)
    at async Promise.all (index 0)
    at async buildWithConfigs (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/build-TmLngPCw.mjs:691:18)
    at async CAC.<anonymous> (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/run.mjs:25:2)
    at async runCLI (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/run.mjs:49:3)

if lang="scss" is added to the style tag, we get a different error:

> [email protected] build
> tsdown

ℹ tsdown v0.21.0 powered by rolldown v1.0.0-rc.7
ℹ config file: /Users/work/Desktop/work/tsdown_issue_example/tsdown.config.ts 
ℹ entry: src/index.ts
ℹ tsconfig: tsconfig.json
ℹ Using Vite config: /Users/work/Desktop/work/tsdown_issue_example/vite.config.ts
ℹ Build start

 ERROR  Error: Build failed with 1 error:

[PARSE_ERROR] Error: Unexpected token
   ╭─[ src/MyButton.vue?vue&type=style&index=0&scoped=960f1381&lang.scss:2:1 ]
   │
 2 │ .color[data-v-960f1381] {
   │ ┬  
   │ ╰── 
───╯

    at aggregateBindingErrorsIntoJsError (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/error-FTNambir.mjs:48:18)
    at unwrapBindingResult (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/error-FTNambir.mjs:18:128)
    at #build (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/shared/rolldown-build-DQKLqVyb.mjs:3308:34)
    at async build (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/rolldown/dist/index.mjs:46:22)
    at async Promise.all (index 0)
    at async buildSingle (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/build-TmLngPCw.mjs:735:19)
    at async Promise.all (index 0)
    at async buildWithConfigs (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/build-TmLngPCw.mjs:691:18)
    at async CAC.<anonymous> (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/run.mjs:25:2)
    at async runCLI (file:///Users/work/Desktop/work/tsdown_issue_example/node_modules/tsdown/dist/run.mjs:49:3)

Any additional comments?

This issue only occurs when styles are added to Vue components.

If the <style></style> tags exist with no styles present or there are no style tags, it builds fine.

If there are any styles included, including those that aren't used, it fails. scoped doesn't appear to change the error.

Activity

  1. added theissue type on Mar 5, 2026
  2. methompson commented on Mar 5, 2026

    @methompson
    Author

    I am running the project via Node v24.13.1

    Installing @tsdown/css does NOT resolve the issue.

  3. added
    bug
    on Mar 5, 2026
  4. methompson commented on Mar 5, 2026

    @methompson
    Author

    I note that the Vue plugin adds a bunch of "query parameters" to a File URI: '/Users/work/Desktop/work/tsdown_issue_example/src/MyButton.vue?vue&type=style&index=0&lang.css'

    I'm curious if the logic for finding the file is looking for lang.css instead of MyButton.vue...

  5. sxzz commented on Mar 5, 2026

    @sxzz
    Member

    Please try https://github.com/rolldown/tsdown/runs/65920557264. Please feel free to provide feedback if you encounter any issues.

  6. methompson commented on Mar 5, 2026

    @methompson
    Author

    Thanks for the quick turnaround. The project built fine with that updated version.
    I'll keep reporting things as I find them.

  7. added a commit that references this issue on Mar 7, 2026
    c421fa5
  8. locked and limited conversation to collaborators on Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcss

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions