Skip to content

Remote functions errors when rolldown-vite is used #14104

@sapphi-red

Description

@sapphi-red

Describe the bug

The following error happens when a remote function is called in a built application:

Cannot find module '/path/to/this/repository/packages/kit/test/apps/basics/.svelte-kit/output/server/assets/remote-entry-tMlqBMhW.js' imported from /path/to/this/repository/packages/kit/test/apps/basics/.svelte-kit/output/server/remote/1lldu3f.js (500 Internal Error)

Reproduction

  1. add
"overrides": {
	"vite": "npm:rolldown-vite@^7.1.0-beta.0"
}

to package.json of this repository
2. run pnpm i && pnpm build && pnpm preview in /packages/kit/test/apps/basics
3. open http://localhost:4173/remote

Logs

System Info

System:
    OS: Linux 6.6 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
    CPU: (32) x64 AMD Ryzen 9 9950X 16-Core Processor
    Memory: 15.87 GB / 23.46 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 22.16.0 - ~/.local/share/asdf/data/installs/nodejs/22.16.0/bin/node
    npm: 10.9.2 - ~/.local/share/asdf/data/plugins/nodejs/shims/npm
    pnpm: 10.14.0 - ~/.local/share/asdf/data/installs/nodejs/22.16.0/bin/pnpm
    bun: 1.2.17 - ~/.local/share/asdf/data/shims/bun
  npmPackages:
    @sveltejs/kit: workspace:^ => 2.27.0 
    @sveltejs/vite-plugin-svelte: catalog: => 6.0.0-next.3 
    rolldown-vite:  7.1.0-beta.0 
    svelte: ^5.35.5 => 5.35.5

Severity

serious, but I can work around it

Additional Information

It is probably because the remote functions feature relies on an optimization that is implemented in Rollup but not yet in Rolldown (rolldown/rolldown#4812).

I didn't trace down in details, but my guess is that this import is the one affecting the chunking.

code: `import * as ${namespace} from '__sveltekit/remote';\n\n${exports.join('\n')}\n`

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions