Skip to content

Edge Runtime Incompatibility #44

Open
@LilaRest

Description

@LilaRest

Hello @ljharb!
First, thanks for all the hard work on your libraries.

Our NextJS builds are failing with the following error since our last dependencies upgrade:

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 'traverse/index.js' in 'REDACTED'

After hours of investigation, it led us to this repository and is-async-function. Those two are using Function('return async function () {}')(); which is considered dynamic code by the compiler.

We are not using these two libraries directly, but instead use traverse which indirectly relies on those two libraries. And it's likely that in the most recent version of traverse (or of one of its dependencies), is-async-function and is-generator-function have been introduced as dependencies, so breaking our builds.

Is there an easy way for you to remove these "dynamic code" parts to unlock edge runtime support? Or should we explore other solutions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions