You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lodash uses Function(String) which is unsupported in the v8 Edge runtimes like Cloudflare Workers. This is being picked up by transpilers, like the one in Next.js which prevents projects being built and deployed on platforms like Vercel.
Example error messages in Next.js projects
3:30:14 PM: Failed to compile.
3:30:14 PM:
3:30:14 PM: ./node_modules/lodash/_root.js
3:30:14 PM: Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime
3:30:14 PM: Import trace for requested module:
3:30:14 PM: ./node_modules/lodash/isBuffer.js
3:30:14 PM: ./node_modules/lodash/_arrayLikeKeys.js
3:30:14 PM: ./node_modules/lodash/keysIn.js
3:30:14 PM: ./node_modules/lodash/_getAllKeysIn.js
3:30:14 PM: ./node_modules/lodash/pickBy.js
3:30:14 PM: ./src/utils/utils.js
3:30:14 PM: ./src/middleware.js
Failed to compile.
../../node_modules/.pnpm/[email protected]/node_modules/lodash/_root.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/.pnpm/[email protected]/node_modules/lodash/_root.js
../../node_modules/.pnpm/[email protected]/node_modules/lodash/_cloneBuffer.js
../../node_modules/.pnpm/[email protected]/node_modules/lodash/_baseClone.js
../../node_modules/.pnpm/[email protected]/node_modules/lodash/omit.js
../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/prisma-extension-nested-operations/dist/esm/lib/utils/execution.js
../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/prisma-extension-nested-operations/dist/esm/lib/nestedOperations.js
../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/prisma-extension-nested-operations/dist/esm/index.js
../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/prisma-extension-soft-delete/dist/esm/lib/createSoftDeleteExtension.js
../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/prisma-extension-soft-delete/dist/esm/index.js
./lib/prisma.ts
./lib/auth.ts
Description
Lodash uses
Function(String)
which is unsupported in the v8 Edge runtimes like Cloudflare Workers. This is being picked up by transpilers, like the one in Next.js which prevents projects being built and deployed on platforms like Vercel.Example error messages in Next.js projects
Prior reports
Incompatible code:
Function(String)
: https://github.com/search?q=repo:lodash/lodash+Function('&type=code)Workaround
I'm patching the offending code out in my next.js projects with this: https://gist.github.com/Thinkscape/ca9a7e47e3b44a5cc92d8e552f455eb6
The text was updated successfully, but these errors were encountered: