Skip to content

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

@kevinrenskers

Description

@kevinrenskers

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/[email protected]/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/[email protected]/node_modules/fsevents/fsevents.node:1:0 (/Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/[email protected]/node_modules/chokidar/index.js)

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

    at getRollupError (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/parseAst.js:401:41)
    at ParseError.initialise (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:14305:28)
    at convertNode (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:16209:10)
    at convertProgram (file:///Users/kevin/Workspace/sr/www.soundradix.com/node_modules/.pnpm/[email protected]/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/[email protected]/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/[email protected]/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions