Open
Description
I am trying to use gray-matter in Next.js edge runtime. But it seems that the library is not compatible with edge runtime. I am getting the following error:
Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation
The error was caused by importing 'gray-matter/index.js' in './lib/api.ts'.
I get the error even when disabling eval:
const {data, content} = matter(fileContents, {eval: false})
Is there any way to make this library edge friendly? Does anybody know any alternative that can be used with edge?
Metadata
Assignees
Labels
No labels