contentlayerdev / contentlayerdev/next-contentlayer-example

Example does not run on vercel edge?

未關閉
#23 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
104
分支
37
PR 合併指標
30 天內沒有已合併 PR

描述

Here is the repo:
https://github.com/yongyi520/contentlayer-example

I have cloned this repo and simply added
`export const runtime = 'edge' // 'nodejs' (default) | 'edge'`

on all pages

When I tried to deploy it to vercel, I got this issue:
**EvalError: Code generation from strings disallowed for this context**
![Screenshot 2023-09-09 at 14 31 39](https://github.com/contentlayerdev/next-contentlayer-example/assets/10789851/1c8752d9-8842-4473-a427-7b18db36531a)

Everything works fine on nodejs serverless, but when it's on edge it throws error somehow

Is there a workaround for this?

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

複製連結的 next-contentlayer-example 儲存庫,將回報的 `runtime = 'edge'` 設定套用至頁面,並部署至 Vercel 以重現 EvalError。比較 Edge 與 Node.js 部署;當範例在 Edge runtime 上成功部署並執行,或限制與 workaround 已完成文件化時,工作即告完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
nextjs, typescript
領域
backend, cloud
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。