diff --git a/.changeset/brown-onions-hug.md b/.changeset/brown-onions-hug.md new file mode 100644 index 00000000..b08faf39 --- /dev/null +++ b/.changeset/brown-onions-hug.md @@ -0,0 +1,5 @@ +--- +'vite-plugin-kit-routes': patch +--- + +fix: some +page.server can have no action (a load only), not it's managed. diff --git a/packages/vite-plugin-kit-routes/src/lib/plugin.ts b/packages/vite-plugin-kit-routes/src/lib/plugin.ts index d8abc713..e8c54024 100644 --- a/packages/vite-plugin-kit-routes/src/lib/plugin.ts +++ b/packages/vite-plugin-kit-routes/src/lib/plugin.ts @@ -409,7 +409,7 @@ const getActionsOfServerPages = (pathFile: string) => { if (declarations) { declarations.forEach((declaration: any) => { if (declaration.id.name === 'actions') { - const properties = declaration.init.expression.properties + const properties = declaration.init.expression?.properties if (properties) { properties.forEach((property: any) => { actions.push(property.key.name)