Skip to content

adapter-static fallback page not generated when prerender.enabled is false #1588

@seanaye

Description

@seanaye

Describe the bug
Using the adapter static in "SPA" configuration doesn't output any html entry point even though the build completes without errors. All other bundled assets are created as far as i can tell. /build contains

/_app
  |--/assets
  |--/chunks
  |--/pages
  |--...misc.js
_redirects

Logs
Build completes successfully with logs ending in

vite v2.3.3 building SSR bundle for production...
✓ 38 modules transformed.
.svelte-kit/output/server/app.js   396.41kb

Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-static
  ✔ done
✨  Done in 3.72s.

To Reproduce
svelte.config.js

import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-static';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  // Consult https://github.com/sveltejs/svelte-preprocess
  // for more information about preprocessors
  preprocess: preprocess(),
  kit: {
    // hydrate the <div id="svelte"> element in src/app.html
    target: '#svelte',
    adapter: adapter({
      fallback: "index.html"
    }),
    prerender: {
      enabled: false
    },
    ssr: false,
    vite: {
      ssr: {
        noExternal: ["chart.js"]
      },
    }
  }
};

export default config;

To help us help you, if you've found a bug please consider the following:

  • If possible, we recommend creating a small repo that illustrates the problem.
  • Reproductions should be small, self-contained, correct examples – http://sscce.org.

Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.

Expected behavior
Entrypoint index html should be generated in the root of the build dir

Stacktraces
N/A

Information about your SvelteKit Installation:

Diagnostics

System:
OS: macOS 11.1
CPU: (8) arm64 Apple M1
Memory: 520.03 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.1.0 - ~/.nvm/versions/node/v16.1.0/bin/node
Yarn: 1.22.10 - /opt/homebrew/bin/yarn
npm: 7.11.2 - ~/.nvm/versions/node/v16.1.0/bin/npm
Browsers:
Brave Browser: 91.1.25.68
Firefox: 88.0.1
Safari: 14.0.2
npmPackages:
@sveltejs/kit: ^1.0.0-next.110 => 1.0.0-next.110
svelte: ^3.34.0 => 3.38.2

  • Adapter-Static

Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of SvelteKit entirely?

This is medium high severity, we are unable to deploy our svelte kit SPA, although the dev server works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions