Skip to content

Commit

Permalink
Added workers-edge-runtime troubleshooting guide (#536)
Browse files Browse the repository at this point in the history
Adds a troubleshooting guide for issues regarding the JS SDK on Vercel
Edge Runtime, Cloudflare Workers

---------

Co-authored-by: Mish Ushakov <mishushakov@users.noreply.github.com>
  • Loading branch information
mishushakov and mishushakov authored Jan 13, 2025
1 parent 7f57364 commit bb18407
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Vercel Edge Runtime and Cloudflare Workers

The E2B JavaScript SDK currently lacks support for Vercel Edge Runtime and Cloudflare Workers due to transport layer package incompatibility used for Sandbox communication. We recommend using supported runtimes like Node, Bun, or Deno instead.
14 changes: 6 additions & 8 deletions apps/web/src/components/Navigation/NavigationLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function NavigationLink({
className,
link,
}: {

className?: string
link: NavLink
}) {
Expand All @@ -18,7 +17,8 @@ export function NavigationLink({
const hash = typeof window !== 'undefined' ? window.location.hash : ''

// Modify the isActive check to include hash comparison if needed
const isActive = pathname === link.href ||
const isActive =
pathname === link.href ||
(link.href.includes('#') && pathname + hash === link.href)
// const pathname = usePathname()
// console.log(link)
Expand All @@ -34,19 +34,17 @@ export function NavigationLink({
isActive
? 'text-white bg-zinc-800'
: 'hover:text-white text-zinc-400 bg-transparent',
className,
className
)}
>
<div className="flex items-center justify-start gap-1">
<div className="flex items-center justify-start gap-1 overflow-hidden">
{link.icon}
{link.tag ? (
<div className="flex items-center gap-2">
<span className={clsx('truncate', isActive ? 'text-white' : '')}>
{link.title}
</span>
<Tag>
{link.tag}
</Tag>
<Tag>{link.tag}</Tag>
</div>
) : (
<span className={clsx('truncate', isActive ? 'text-white' : '')}>
Expand All @@ -56,4 +54,4 @@ export function NavigationLink({
</div>
</Link>
)
}
}
11 changes: 10 additions & 1 deletion apps/web/src/components/Navigation/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,15 @@ export const docRoutes: NavGroup[] = [
{
title: 'Troubleshooting',
items: [
{
title: 'SDKs',
links: [
{
title: 'Vercel Edge Runtime and Cloudflare Workers',
href: '/docs/troubleshooting/sdks/workers-edge-runtime',
},
],
},
{
title: 'Templates',
links: [
Expand Down Expand Up @@ -486,4 +495,4 @@ export const sdkRefRoutes: VersionedNavGroup[] = (
group?.title && sdkRefNameMap[group.title]
? sdkRefNameMap[group.title]
: group.title,
}))
}))

0 comments on commit bb18407

Please sign in to comment.