Skip to content

Commit

Permalink
fix: use optional chaining when checking router type (#13218)
Browse files Browse the repository at this point in the history
* fix: use optional chaining when checking router type

* no need for changeset, nothing was released yet

* Revert "no need for changeset, nothing was released yet"

This reverts commit cff720b.
  • Loading branch information
Rich-Harris authored Dec 21, 2024
1 parent f103084 commit fe98a21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/strange-wolves-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-static': patch
---

fix: use optional chaining when checking router type
2 changes: 1 addition & 1 deletion packages/adapter-static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function (options) {
name: '@sveltejs/adapter-static',

async adapt(builder) {
if (!options?.fallback && builder.config.kit.router.type !== 'hash') {
if (!options?.fallback && builder.config.kit.router?.type !== 'hash') {
const dynamic_routes = builder.routes.filter((route) => route.prerender !== true);
if (dynamic_routes.length > 0 && options?.strict !== false) {
const prefix = path.relative('.', builder.config.kit.files.routes);
Expand Down

0 comments on commit fe98a21

Please sign in to comment.