Skip to content

Build apps with rolldown-vite #492

@imslepov

Description

@imslepov

Clear and concise description of the problem

I’m trying to integrate rolldown-vite into my app following the instructions at https://vite.dev/guide/rolldown

But I encountered an issue when running npm run build:

rolldown-vite v6.3.7 building for production...
✓ 37 modules transformed.
✗ Build failed in 129ms
error during build:
Build failed with 1 error:

[PARSE_ERROR] Error: Unexpected token
   ╭─[ src/locales/en.json:1:1 ]
   │
 1 │ const resource = {
   │ ──┬──  
   │   ╰──── 
───╯

    at normalizeErrors (file:///Users/imslepov/Documents/frontend/rolldown-demo-app/node_modules/rolldown/dist/shared/src-RpijPf9P.mjs:2222:18)
    at handleOutputErrors (file:///Users/imslepov/Documents/frontend/rolldown-demo-app/node_modules/rolldown/dist/shared/src-RpijPf9P.mjs:4355:34)
    at transformToRollupOutput (file:///Users/imslepov/Documents/frontend/rolldown-demo-app/node_modules/rolldown/dist/shared/src-RpijPf9P.mjs:4349:2)
    at RolldownBuild.write (file:///Users/imslepov/Documents/frontend/rolldown-demo-app/node_modules/rolldown/dist/shared/src-RpijPf9P.mjs:5574:11)
    at async buildEnvironment (file:///Users/imslepov/Documents/frontend/rolldown-demo-app/node_modules/vite/dist/node/chunks/dep-92_HHwpq.js:44306:16)
    at async Object.defaultBuildApp [as buildApp] (file:///Users/imslepov/Documents/frontend/rolldown-demo-app/node_modules/vite/dist/node/chunks/dep-92_HHwpq.js:44810:5)
    at async CAC.<anonymous> (file:///Users/imslepov/Documents/frontend/rolldown-demo-app/node_modules/vite/dist/node/cli.js:863:7)

But npm run dev works fine.

I didn't find any issue related to rolldown, not sure if you know about this problem. 🙂

Suggested solution

Support rolldown

Alternative

No response

Additional context

Reproduction link: https://stackblitz.com/edit/vitejs-vite-9m1qwabx?file=vite.config.ts&terminal=build

Validations

  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❗ p4-importantPriority 4: bugs that violate documented behavior, or significantly impact perf

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions