@builder.io/sdk-react: NextJS: failure to load in SSR
See original GitHub issueDescribe the bug
When using the recently released Beta React SDK @builder.io/sdk-react@0.0.1-1 with Next.js and Next.js throws and error Server Error SyntaxError: Cannot use import statement outside a module
when trying to server-side render the builder RenderContent
component.
To Reproduce Stackblitz
Expected behavior We can use the builder SDK with SSR (eventually we will want to use server component with the SDK)
Additional context one workaround to is only render the Builder component on the client.
Thanks for the help! I’m excited to see that the bundle size is only 13 kB. Seems more reasonable.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Next.js SSR pages are failing in production builds · Issue #6736
Building and starting a next.js project that has an SSR page with nx build is giving Internal Server Error , but not with...
Read more >react-hydration-error - Next.js
When css-in-js libraries are not set up for pre-rendering (SSR/SSG) it will often lead to a hydration mismatch. In general this means the...
Read more >Next js app with SSR is not pre-rendering HTML, so web ...
Within the auth context file, I was performing conditional rendering, depending on a loading state, which was causing SSR not to take place:....
Read more >Implementing SSR in Next.js: Dynamic routing and prefetching
This happens because named, or static, routes have a higher priority than a dynamic route. For example, if you have declared a dynamic...
Read more >How to disable Server-Side Rendering in Next.js
There are some instances where you don't need SSR for your Next.js components. In this article, we'll go over how you can disable...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @samijaber, that’s looking great!
Thanks for the quick fix.
Ah, we need to add
type: module
to the npm package. Will do that and test it out soon