kit icon indicating copy to clipboard operation
kit copied to clipboard

adapter-netlify ignores fallback for 404 errors if split:true

Open gigor opened this issue 1 year ago • 1 comments

Describe the bug

Netlify displays its own standard 404 error instead of the one produced by +error.page with the following config for adapter-netlify:

fallback: '404.html',
split: true,

Reproduction

Stackblitz: https://stackblitz.com/edit/sveltejs-kit-template-default-9pkv6k Github: https://github.com/gigor/sk-netlify-404 Netlify: https://mellifluous-valkyrie-c1dbe5.netlify.app/404

Logs

No response

System Info

System:
    OS: macOS 13.6.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 221.10 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.5.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: 7.14.1 - /usr/local/bin/pnpm
  Browsers:
    Brave Browser: 120.1.61.120
    Chrome: 119.0.6045.159
    Safari: 17.2.1

Severity

serious, but I can work around it

Additional Information

The workaround I found is to create a routes/404/+page.svelte. It will create 404.html in the root of the build folder, and Netlify will use it instead of its default error page.

gigor avatar Feb 15 '24 11:02 gigor

I don’t think the netlify adapter has a fallback adapter option currently according to the docs. https://kit.svelte.dev/docs/adapter-netlify
Regardless, the desired behaviour would be hitting a static generated fallback page or the function itself so it displays the root error page similar to the vercel adapter

teemingc avatar Feb 15 '24 12:02 teemingc