-
I have a completely static website with a lot of JSON data. Because the JSON data is complex, I wanted to process and add to a
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
@flybayer do you know if this might be possible? |
Beta Was this translation helpful? Give feedback.
-
How are you importing/opening the db? Vercel deploy works like this:
So it sounds like (2) could be the issue, I don't think this is a Blitz build issue. If you need, you could do a minimal repo with plain next.js and see if you still have the issue there. That said, here's a workaround that should work for (2). Add this to your code somewhere:
|
Beta Was this translation helpful? Give feedback.
-
@flybayer i tried using // This function gets called during pre-rendering
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export async function getStaticProps() {
const category = useQuery(getCategoryPage, { where: { categoryCode: 'hello_world' } });
return {
props: {
category,
},
};
}
Home.getLayout = (page) => (
<Suspense fallback={<FallbackUI />}>
<Layout title="Home">{page}</Layout>
</Suspense>
);
export default Home; The query works fine when I put it in my component. I'm just struggling to figure out how to call I looked at the |
Beta Was this translation helpful? Give feedback.
@flybayer i tried using
useQuery
ingetStaticProps
but since thats a function and not a component, React complains about using hooks in a function and not a component. My code is below:The query works fine when I put it in my compone…