Skip to content

SSG / adapter-static strict = false not working like documented #9592

@0xElectric

Description

@0xElectric

Describe the bug

adapter-static's strict: false not working like documented
I have a link in my hero section that goes to /get-started which doesn't exists.
setting strict: false should ignore this but it doesn't.

Reproduction

  1. follow steps: https://kit.svelte.dev/docs/adapter-static#usage

  2. add a link that doesn't exist in the project e.g. <a href="/non-existent"></a>

  3. npm run build

Logs

.
.
.
✓ built in 2.41s
file:///home/user/code/project-dir/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:53
                                        throw new Error(format(details));
                                              ^

Error: 404 /get-started/ (linked from /get-started)
    at file:///home/user/code/project-dir/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:53:12
    at save (file:///home/user/code/project-dir/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:359:4)
    at visit (file:///home/user/code/project-dir/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:211:3)
[vite-plugin-sveltekit-compile] Failed with code 1
✓ built in 6.21s
error during build:
Error: Failed with code 1
    at ChildProcess.<anonymous> (file:///home/user/code/project-dir/node_modules/@sveltejs/kit/src/utils/fork.js:68:13)
    at ChildProcess.emit (node:events:513:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

System Info

System:
    OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-11320H @ 3.20GHz
    Memory: 4.88 GB / 15.41 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
  Browsers:
    Brave Browser: 111.1.49.132
    Chrome: 111.0.5563.146
    Firefox: 111.0.1
  npmPackages:
    @sveltejs/adapter-auto: ^1.0.3 => 1.0.3 
    @sveltejs/adapter-node: ^1.2.3 => 1.2.3 
    @sveltejs/adapter-static: ^2.0.1 => 2.0.1 
    @sveltejs/kit: ^1.15.0 => 1.15.0 
    svelte: ^3.58.0 => 3.58.0 
    vite: ^4.2.1 => 4.2.1

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions