Skip to content

In adapter-netlify split-true breaks SSR when using optional params  #9825

Open
@el-sonny

Description

@el-sonny

Describe the bug

When split: true is set on the netlify adapter, routes with optional parameters cease to work when the optional parameter is not set. For example the route /collection/[[optional]]/article will fail if /collection/article (without optional parameter) is loaded through the server.

Reproduction

  1. Create new empty sveltekit project
  2. Add adpater-netlify and configure with split:true option
  3. Add a route with optional parameter like: /collection/[[optional]]/article
  4. Deploy to netlify and enter URL like /collection/article it should give 404 error.

I made a test repository and deploy:

Logs

No response

System Info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 541.80 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Brave Browser: 112.1.50.119
    Chrome: 112.0.5615.137
    Safari: 16.3
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.0.1 
    @sveltejs/adapter-netlify: ^1.0.0-next.88 => 1.0.0-next.88 
    @sveltejs/kit: ^1.5.0 => 1.15.10 
    svelte: ^3.54.0 => 3.58.0 
    vite: ^4.3.0 => 4.3.4

Severity

serious, but I can work around it

Additional Information

This issue is related:

#4872

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions