Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js App Router Error: Dynamic Code Evaluation not allowed in Edge Runtime #455

Open
grantoesterling opened this issue Jul 19, 2024 · 3 comments

Comments

@grantoesterling
Copy link

Running into the Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime error when adding the frame creation to generateMetadata in my Next14 app, as laid out in the docs here: https://framesjs.org/reference/core/next

Am I missing something or is this broken? :)

@michalkvasnicak
Copy link
Collaborator

@grantoesterling could you provide minimum reproducible code? We don't use WebAssembly directly so it must be an issue with some package. Since you provided only the error message it's hard to know where that happened.

@davidfurlong
Copy link
Contributor

It sounds like some other part of your code isn't compatible with Vercel's edge runtime. You may want to try configuring it to use the Node.js runtime https://vercel.com/docs/functions/configuring-functions/runtime#node.js

@grantoesterling
Copy link
Author

@michalkvasnicak sorry I should have included this, seems to be failing because of one of the framejs imports

../../node_modules/@protobufjs/inquire/index.js
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

Import trace for requested module:
../../node_modules/@protobufjs/inquire/index.js
../../node_modules/protobufjs/src/util/minimal.js
../../node_modules/protobufjs/src/index-minimal.js
../../node_modules/protobufjs/minimal.js
../../node_modules/frames.js/dist/chunk-MI43JRER.js
../../node_modules/frames.js/dist/next/index.js
./src/app/collections/[idOrSlug]/page.tsx


> Build failed because of webpack errors

@davidfurlong reasonably certain it isn't another part of my code as the error disappears when I comment the frame.js await fetchMetadata piece out of the generateMetadata section of that page. Tried adding that nodejs runtime to the framejs route but still getting the same error

Worth noting this is on Next 14.1.3 and frames.js version 0.17.4

@davidfurlong davidfurlong added the Frames.js label Sep 13, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants