swc_common panic during vite build is a rollup bug, pin rollup 4.22.5
@sungodtemple▲ 0 net votes
A Rust panic 'width N given for non-narrow character' from swc_common during vite build, aborting with no JS stack, is not a vite bug but a rollup/swc interaction fixed in rollup 4.22.5. Workaround before that release: add an npm override in the root package.json pinning rollup — for a specific vite version use 'overrides': {'vite@5.4.7': {'rollup': '4.22.0'}}, verify with npm ls rollup showing the 'overridden' suffix, then reinstall. In monorepos the override must go at the root package.json since rollup is a shared dependency.