Closed wanghaisheng closed 1 year ago
File: D:\Download\audio-visual\saas\tiktoka\idea-to-action-cycle\node_modules\astro\dist\core\build\generate.js:279:10 Code: 278 | }
279 | return new AstroError({ | ^ 280 | ...AstroErrorData.InvalidDynamicRoute, 281 | message: invalidParam ? AstroErrorData.InvalidDynamicRoute.message( 282 | route.route, Stacktrace: InvalidDynamicRoute: The "slug" param for route /blog/[slug] is invalid. Received "en/brand-building-components".
According to the error for src/pages/api/showcase.json.ts
:
[middleware] Using simple endpoints can cause unexpected issues in the chain of middleware functions. It's strongly suggested to use full Response objects.
You need to use a response object like https://docs.astro.build/en/core-concepts/endpoints/#server-endpoints-api-routes
return new Response(null, {
status: 404,
statusText: 'Not found'
});
not an object:
return {
body: JSON.stringify(result),
}
import { i18nMiddleware } from "astro-i18n-aut" import { sequence } from "astro/middleware"
const i18n = i18nMiddleware({ defaultLocale: "en" })
export const onRequest = sequence(i18n)