Skip to content

Commit

Permalink
fix: run makeswift provider in nodejs runtime
Browse files Browse the repository at this point in the history
@note: makeswift provider depends on nodejs stream
  • Loading branch information
matthewvolk committed Jun 21, 2024
1 parent eaaf591 commit 9709430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 8 additions & 1 deletion app/[locale]/(default)/[...rest]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getSiteVersion } from '@makeswift/runtime/next/server';
import { notFound } from 'next/navigation';

import { client } from '~/makeswift/client';
import { MakeswiftProvider } from '~/makeswift/provider';

interface CatchAllParams {
locale: string;
Expand All @@ -26,5 +27,11 @@ export default async function Page({ params }: { params: CatchAllParams }) {

if (snapshot == null) return notFound();

return <MakeswiftPage snapshot={snapshot} />;
return (
<MakeswiftProvider>
<MakeswiftPage snapshot={snapshot} />
</MakeswiftProvider>
);
}

export const runtime = 'nodejs';
7 changes: 1 addition & 6 deletions app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
import { PropsWithChildren } from 'react';

import { CompareProductsProvider } from '~/app/contexts/compare-products-context';
import { MakeswiftProvider } from '~/makeswift/provider';

export function Providers({ children }: PropsWithChildren) {
return (
<MakeswiftProvider>
<CompareProductsProvider>{children}</CompareProductsProvider>
</MakeswiftProvider>
);
return <CompareProductsProvider>{children}</CompareProductsProvider>;
}

0 comments on commit 9709430

Please sign in to comment.