-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
adapter-static fallback
page not generated when prerender.enabled
is false
#1588
Comments
For a workaround, you can change the pages config and it will work. |
I'm pretty sure that currently, prender has to be set as well. Can't confirm yet, because when I enable prerender, my app doesn't build, despite working in development. Alot of ESM bugs like
But that's probably more to do with #612 and #503 and apollographql/apollo-client#8218. If we had a true spa mode, that would also likely fix this. |
I'm having the same problem as @NickClark. If I turn on prerender a lot of import bugs as he points out:
Same happens, for instance, with On the other hand, if I turn off prerendering, then the fallback page is not generated. |
I believe the root cause of this issue is the following check: kit/packages/kit/src/core/adapt/utils.js Line 39 in 0befffb
The following svelte.config.js options provided a workaround of this issue for me: ...
adapter: adapter({
fallback: 'index.html'
}),
ssr: false,
prerender: {
// workaround issue 1588 by still having prerendering happen with smallest scope possible
// enabled: false
pages: ['/'],
crawl: false
},
... |
I'm having an issue that may be related. When I build with adapter-static in PWA mode, it correctly builds, then correctly renders, but only on my dev machine. When I copy the project to a build server, the build works, but when adapter static tries to render the fallback page, it fails, and the error message is similar to those described above where it claims it is missing imports. I've diff-ed the |
Can anyone provide a repo that reproduces this issue? |
@benmccann Adding the following to prerender: {
enabled: false
},
ssr: false, PR #2128 makes the tests pass again. Would the above config changes make a more representative "spa mode" test or would you prefer an separate test app from prerendered and spa be created? |
fallback
page not generated when prerender.enabled
is false
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
containsLogs
Build completes successfully with logs ending in
To Reproduce
svelte.config.js
To help us help you, if you've found a bug please consider the following:
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
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
The text was updated successfully, but these errors were encountered: