Skip to content

adapter-cloudflare doesn't understand kit.paths.base #2843

@tv42

Description

@tv42

Describe the bug

I wish to use multiple SvelteKit apps on one domain, hence I must use base to separate them, to avoid each one of them thinking they are special and get to own the URL /_app.

If I set svelte.config.js config.kit.paths.base = '/foo', and use the @sveltejs/adapter-cloudflare adapter, npx wrangler@beta pages dev .svelte-kit/cloudflare/ results in it not finding the assets.

It seems SvelteKit assumes that the assets are served with base as a prefix (that is, file _app at the root of the static files is found by the browser at ${base}/_app), while the adapter never considers the value of base.

Reproduction

(sorry, not yet done)

Logs

No response

System Info

System:
    OS: Linux 5.14 NixOS 21.11 (Porcupine) 21.11 (Porcupine)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 34.80 GB / 62.61 GB
    Container: Yes
    Shell: 5.1.8 - /nix/store/xdxv22yb7qnjfyf997r9fx804761z14c-bash-interactive-5.1-p8/bin/bash
  Binaries:
    Node: 16.13.0 - /nix/store/26lslfmvwyhspppbinznh111fyaxx62z-nodejs-16.13.0/bin/node
    npm: 8.1.0 - /nix/store/26lslfmvwyhspppbinznh111fyaxx62z-nodejs-16.13.0/bin/npm
  Browsers:
    Firefox: 94.0.1
  npmPackages:
    @sveltejs/adapter-cloudflare: ^1.0.0-next.2 => 1.0.0-next.2
    @sveltejs/kit: next => 1.0.0-next.191
    svelte: ^3.34.0 => 3.44.0

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions