Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

fix(docs): Fix some Hydration errors (#87)

Pavel 'Strajk' Dolecek60f4621f7436
diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs
index 5aa485460..f0cda0fff 100644
--- a/apps/docs/next.config.mjs
+++ b/apps/docs/next.config.mjs
@@ -57,7 +57,7 @@ const nextConfig = {
{
source: '/ingest/:path*',
destination: 'https://app.posthog.com/:path*',
- // BEWARE: setting basePath will break the analytics proxy
+ // BEWARE: setting basePath will break the analytics proxy
},
]
},
diff --git a/apps/docs/src/app/getting-started/basics/page.mdx b/apps/docs/src/app/getting-started/basics/page.mdx
index d4246d087..50f8993a2 100644
--- a/apps/docs/src/app/getting-started/basics/page.mdx
+++ b/apps/docs/src/app/getting-started/basics/page.mdx
@@ -14,7 +14,7 @@ export const sections = [
# Basic Usage
Following code snippets should get you going fast with primitives in our SDK.
-For more real-life scenarios head to the [Examples section](./examples/overview). {{ clasName: 'lead' }}
+For more real-life scenarios head to the [Examples section](./examples/overview). {{ className: 'lead' }}
There are two main primitives in our SDK that you use to interact with the cloud playground:
- [Filesystem](/getting-started/basics#filesystem)
@@ -113,4 +113,4 @@ Here are the basic operations you can do with the process inside a cloud playgro
<CodeGroup>
```python {{ language: 'python', snippet: 'python/basics/process_stream_stderr.py' }}
```
-</CodeGroup>
\ No newline at end of file
+</CodeGroup>
diff --git a/apps/docs/src/app/pricing/page.mdx b/apps/docs/src/app/pricing/page.mdx
index d75a7a55b..b646645d3 100644
--- a/apps/docs/src/app/pricing/page.mdx
+++ b/apps/docs/src/app/pricing/page.mdx
@@ -6,8 +6,8 @@ export const metadata = {
# Pricing
-E2B is currently in beta and free to use. {{ clasName: 'lead' }}
+E2B is currently in beta and free to use. {{ className: 'lead' }}
We're going to offer both free and premium tiers in the future. Pricing will be based on usage of our [cloud playgrounds](/playgrounds/overview) through the SDK.
-Our goal is to offer a free tier for hobbyists and personal projects and a premium tier for companies or projects with high usage. Similarly to for example [Supabase](https://supabase.com/pricing) or [Vercel](https://vercel.com/pricing).
\ No newline at end of file
+Our goal is to offer a free tier for hobbyists and personal projects and a premium tier for companies or projects with high usage. Similarly to for example [Supabase](https://supabase.com/pricing) or [Vercel](https://vercel.com/pricing).
diff --git a/apps/docs/src/components/Code.tsx b/apps/docs/src/components/Code.tsx
index 199fd4ef8..0181539e8 100644
--- a/apps/docs/src/components/Code.tsx
+++ b/apps/docs/src/components/Code.tsx
@@ -128,6 +128,9 @@ function CodeGroupHeader({
<Tab.List className="-mb-px flex gap-4 text-xs font-medium">
{Children.map(children, (child, childIndex) => (
<Tab
+ /* Set ID due to bug in Next https://github.com/vercel/next.js/issues/53110 */
+ /* Should ne fixed after updating Next to > 13.4.12 */
+ id={`code-tab-${childIndex}`}
className={clsx(
'border-b py-3 transition ui-not-focus-visible:outline-none',
childIndex === selectedIndex
@@ -153,8 +156,10 @@ function CodeGroupPanels({
if (hasTabs) {
return (
<Tab.Panels>
- {Children.map(children, (child) => (
- <Tab.Panel>
+ {/* Set ID due to bug in Next https://github.com/vercel/next.js/issues/53110 */}
+ {/* Should ne fixed after updating Next to > 13.4.12 */}
+ {Children.map(children, (child, childIndex) => (
+ <Tab.Panel id={`code-tab-${childIndex}`}>
<CodePanel {...props}>{child}</CodePanel>
</Tab.Panel>
))}
diff --git a/apps/docs/src/components/Footer.tsx b/apps/docs/src/components/Footer.tsx
index 101bedf66..70cfd34d2 100644
--- a/apps/docs/src/components/Footer.tsx
+++ b/apps/docs/src/components/Footer.tsx
@@ -41,20 +41,19 @@ function PageLink({
}
function PageNavigation() {
- let pathname = usePathname()
+ let initialPathname = usePathname();
+ // Running on the server, there's bug with usePathname() and basePath https://github.com/vercel/next.js/issues/52700
+ if (typeof window === 'undefined' && initialPathname === '/') initialPathname = '/docs'
+
let allPages = navigation.flatMap((group) => group.links)
- let currentPageIndex = allPages.findIndex((page) => page.href === pathname)
+ let currentPageIndex = allPages.findIndex((page) => page.href === initialPathname)
- if (currentPageIndex === -1) {
- return null
- }
+ if (currentPageIndex === -1) return null
let previousPage = allPages[currentPageIndex - 1]
let nextPage = allPages[currentPageIndex + 1]
- if (!previousPage && !nextPage) {
- return null
- }
+ if (!previousPage && !nextPage) return null
return (
<div className="flex">