Demo app cannot be built with the static adapter since the introduction of shadow endpoints (error 500 /todos)
See original GitHub issueDescribe the bug
PR3679 has broken the demo application build process for static adapter. It now shows a 500 error when doing build.
Reproduction
Steps to reproduce:
npm init svelte@next functions
Use TypeScript? … Yes Add ESLint for code linting? … Yes Add Prettier for code formatting? … Yes
cd functions
npm install
Change adaptor to static in svelte.config.js
import adapter from '@sveltejs/adapter-static';
Install the static adapter:
npm install @sveltejs/adapter-static@next
Build project
npm run build
npm run build
functions@0.0.1 build svelte-kit build
vite v2.8.0 building for production… ✓ 34 modules transformed. .svelte-kit/output/client/_app/assets/svelte-logo-87df40b8.svg 1.85 KiB .svelte-kit/output/client/_app/assets/fira-mono-greek-ext-400-normal-9e2fe623.woff2 7.33 KiB .svelte-kit/output/client/_app/assets/fira-mono-cyrillic-ext-400-normal-3df7909e.woff2 15.40 KiB .svelte-kit/output/client/_app/assets/fira-mono-latin-ext-400-normal-6bfabd30.woff2 11.10 KiB .svelte-kit/output/client/_app/assets/fira-mono-cyrillic-400-normal-c7d433fd.woff2 8.89 KiB .svelte-kit/output/client/_app/assets/fira-mono-greek-400-normal-a8be01ce.woff2 10.27 KiB .svelte-kit/output/client/_app/assets/fira-mono-latin-400-normal-e43b3538.woff2 15.90 KiB .svelte-kit/output/client/_app/assets/fira-mono-all-400-normal-1e3b098c.woff 75.55 KiB .svelte-kit/output/client/_app/manifest.json 2.51 KiB .svelte-kit/output/client/_app/pages/__layout.svelte-1fdcf5b9.js 4.76 KiB / gzip: 1.86 KiB .svelte-kit/output/client/_app/error.svelte-6f6d00da.js 1.56 KiB / gzip: 0.75 KiB .svelte-kit/output/client/_app/pages/index.svelte-92dd2217.js 4.08 KiB / gzip: 1.69 KiB .svelte-kit/output/client/_app/pages/about.svelte-64b29582.js 2.38 KiB / gzip: 1.09 KiB .svelte-kit/output/client/_app/pages/todos/index.svelte-0cc5f931.js 5.91 KiB / gzip: 2.40 KiB .svelte-kit/output/client/_app/chunks/singletons-a6a7384f.js 0.05 KiB / gzip: 0.07 KiB .svelte-kit/output/client/_app/start-f44d78f5.js 23.36 KiB / gzip: 7.95 KiB .svelte-kit/output/client/_app/assets/pages/todos/index.svelte-784042c1.css 3.70 KiB / gzip: 1.04 KiB .svelte-kit/output/client/_app/assets/pages/index.svelte-1d45bd0c.css 1.40 KiB / gzip: 0.50 KiB .svelte-kit/output/client/_app/assets/pages/about.svelte-bf4528fa.css 0.11 KiB / gzip: 0.10 KiB .svelte-kit/output/client/_app/chunks/vendor-ee294e9e.js 14.16 KiB / gzip: 6.04 KiB .svelte-kit/output/client/_app/assets/pages/__layout.svelte-15681802.css 4.96 KiB / gzip: 1.55 KiB vite v2.8.0 building SSR bundle for production… ✓ 36 modules transformed. .svelte-kit/output/server/manifest.json 2.15 KiB .svelte-kit/output/server/app.js 63.28 KiB .svelte-kit/output/server/entries/endpoints/todos/index.ts.js 1.23 KiB .svelte-kit/output/server/entries/pages/__layout.svelte.js 4.60 KiB .svelte-kit/output/server/entries/pages/error.svelte.js 0.72 KiB .svelte-kit/output/server/entries/pages/index.svelte.js 8.07 KiB .svelte-kit/output/server/entries/pages/about.svelte.js 1.30 KiB .svelte-kit/output/server/entries/pages/todos/index.svelte.js 5.84 KiB .svelte-kit/output/server/chunks/index-ee9fdf1a.js 4.24 KiB
Run npm run preview to preview your production build locally.
Using @sveltejs/adapter-static 500 /todos at file:///functions/node_modules/@sveltejs/kit/dist/chunks/index5.js:408:11 at visit (file:///functions/node_modules/@sveltejs/kit/dist/chunks/index5.js:585:4) at processTicksAndRejections (internal/process/task_queues.js:95:5)
What has changed:
- Missing [uid].json.ts
- Missing index.json.ts
- New file index.ts
Logs
No response
System Info
System:
OS: macOS 12.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 252.46 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.1 - /usr/local/bin/node
Yarn: 1.22.14 - /usr/local/bin/yarn
npm: 8.1.1 - /usr/local/bin/npm
Browsers:
Brave Browser: 91.1.26.67
Chrome: 98.0.4758.80
Safari: 15.3
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.17
@sveltejs/adapter-static: ^1.0.0-next.26 => 1.0.0-next.26
@sveltejs/kit: next => 1.0.0-next.265
svelte: ^3.46.0 => 3.46.4
Severity
blocking all usage of SvelteKit
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:13 (4 by maintainers)

Top Related StackOverflow Question
I guess I don’t understand what the issue is here. Yes, you could build the demo app with the static adapter before. However, the built app was then non-functional, since you couldn’t interact with the todo list without the server handlers. It’s a good thing that you are now made aware at build time that the production app will not function properly. If you want to build the demo app, you need to use an adapter that supports server endpoints at runtime, which the static adapter does not. The build-time error is expected and desired in this case.
Is there a SvelteKit app besides the demo app that should work with the static adapter and no longer does post the introduction of shadow endpoints?
UPDATE now both are on latest v275
svelte.config.jsI have a couple of public websites ( sveltin.io and docs.sveltin.io ) using the static adapter.
Both work with
sveltekit@1.0.0-next.264andadaper-static@1.0.0-next.28With
sveltekit@1.0.0-next.265and higher, the build process is ok but that the routing is affected (as per #3852 linked to this issue)trailingSlashto any valid option does not work for me too.adapter-staticseems to me to be not aware of the “Pass trailingSlash config to adapters”(https://github.com/sveltejs/kit/pull/3820) like the vercel oneSo far, I have to revert to
sveltekit@1.0.0-next.264Happy to share more info on it