Skip to content

Commit 8c4905b

Browse files
fixup! make site work with the Cloudflare OpenNext adapter
1 parent 5c9ea2e commit 8c4905b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/site/app/[locale]/next-data/download-snippets/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const GET = async (_: Request, props: StaticParams) => {
1111
const params = await props.params;
1212

1313
// Retrieve all available Download snippets for a given locale if available
14-
const snippets = await provideDownloadSnippets(params.locale);
14+
const snippets = provideDownloadSnippets(params.locale);
1515

1616
// We append always the default/fallback snippets when a result is found
1717
return Response.json(snippets, {

apps/site/next-data/downloadSnippets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default async function getDownloadSnippets(
2929
const { default: provideDownloadSnippets } = await import(
3030
'@/next-data/providers/downloadSnippets'
3131
);
32-
return (await provideDownloadSnippets(lang))!;
32+
return provideDownloadSnippets(lang)!;
3333
}
3434

3535
// Applies the language to the URL, since this content is actually localized

apps/site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"test": "turbo test:unit",
2222
"build:worker": "npx opennextjs-cloudflare build",
2323
"postbuild:worker": "node ./.cloudflare/prepare-build.mjs",
24-
"cf:preview": "npm run build:worker && npx wrangler dev",
24+
"cf:preview": "npm run build:worker && sleep 3 && npx wrangler dev",
2525
"cf:deploy": "npx wrangler deploy"
2626
},
2727
"dependencies": {

0 commit comments

Comments
 (0)