#build failed on Vercel due to use of bloom filter in middleware

3 messages · Page 1 of 1 (latest)

viscid monolith
#

i am following this repo to create redirects, just the difference is that i have used javascript - https://github.com/vercel/examples/blob/main/edge-middleware/redirects-bloom-filter/middleware.ts

i have attached my middleware file code in screenshot, when i deploy to vercel it gives below error

Creating an optimized production build ...
Failed to compile.
./middleware.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
The error was caused by importing 'bloom-filters/dist/api.js' in './middleware.js'.
Import trace for requested module:
./middleware.js

Build failed because of webpack errors
Error: Command "npm run build" exited with 1

GitHub

Enjoy our curated collection of examples and solutions. Use these patterns to build your own robust and scalable applications. - vercel/examples

hybrid helmBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

spring aspen
#

Don't ping the mods for troubleshooting help, only for actual moderation issues.