Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
0xElectric opened this issue Apr 3, 2023 · 1 comment · Fixed by #9621
Closed

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

0xElectric opened this issue Apr 3, 2023 · 1 comment · Fixed by #9621
Labels
error handling ready to implement please submit PRs for these issues!
Milestone

Comments

@0xElectric
Copy link

0xElectric commented Apr 3, 2023

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

@dummdidumm
Copy link
Member

This method is not related to this error. To prevent http errors from failing your build while prerendering, implement prerender.handleHttpError.

Leaving this open because it's probably good to note this is on the error message - same for handleMissingId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling ready to implement please submit PRs for these issues!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants