Svelte

Build error "Unexpected character '�'" with SvelteKit 2.21.3

#13919

Development PR

Issue

Solved
K
kevinrenskers
Jun 23, 2025, 12:37 PM

Describe the bug

When I run pnpm build on my local machine I get this:

vite v6.3.5 building SSR bundle for production...
1524 modules transformed.
✗ Build failed in 3.02s
error during build:
[commonjs--resolver] node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.node (1:0): Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
file: /Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/fsevents@2.3.3/node_modules/fsevents/fsevents.node:1:0 (/Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/chokidar@3.6.0/node_modules/chokidar/index.js)

1: ����@<
          ��*...
   ^
4*
   h���/System/Library/Frameworks/CoreFoundation.framework/Versions...
3: ���H��1H���L���L���H�����LEL��H��1�����uH�EH�[A^A_]��}f.�UH��AWAVSPI��H��I��HH...

    at getRollupError (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/rollup@4.44.0/node_modules/rollup/dist/es/shared/parseAst.js:401:41)
    at ParseError.initialise (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/rollup@4.44.0/node_modules/rollup/dist/es/shared/node-entry.js:14305:28)
    at convertNode (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/rollup@4.44.0/node_modules/rollup/dist/es/shared/node-entry.js:16209:10)
    at convertProgram (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/rollup@4.44.0/node_modules/rollup/dist/es/shared/node-entry.js:15452:12)
    at Module.setSource (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/rollup@4.44.0/node_modules/rollup/dist/es/shared/node-entry.js:17201:24)
    at async ModuleLoader.addModuleSource (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/rollup@4.44.0/node_modules/rollup/dist/es/shared/node-entry.js:21214:13)
 ELIFECYCLE  Command failed with exit code 1.

It doesn't seem to happen on the server (which runs Ubuntu, local machine is macOS). It also doesn't happen in SvelteKit 2.21.2.

Reproduction

I'm using TailwindCSS, which has chokidar as a dependency. For me it happens as soon as I run pnpm build on macOS.

Logs

System Info

System:
    OS: macOS 15.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 286.86 MB / 32.00 GB
    Shell: 4.0.2 - /opt/homebrew/bin/fish
  Binaries:
    Node: 20.17.0 - ~/Library/pnpm/node
    npm: 10.8.2 - ~/Library/pnpm/npm
    pnpm: 10.2.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 136.0.7103.114
    Edge: 137.0.3296.93
    Safari: 18.5
  npmPackages:
    @sveltejs/adapter-node: ^5.2.12 => 5.2.12
    @sveltejs/kit: ^2.21.3 => 2.21.3
    @sveltejs/vite-plugin-svelte: ^5.1.0 => 5.1.0
    svelte: ^5.34.7 => 5.34.7
    vite: ^6.3.5 => 6.3.5

Severity

blocking an upgrade

Additional Information

No response

👍 1

Info

Closed at Jul 17, 2025, 5:13 AM
Assignees None
Labels None
Milestone None

Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)