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
req.headers.get('user-agent') of the browser is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36
However the exception is thrown -
error - (middleware)/node_modules/bowser/src/parser.js (95:0) @ eval
Error: Browser's test function is not valid
While trying to use Bowser inside
_middleware
Next.js Middleware Functions (also Vercel doc - https://vercel.com/docs/concepts/functions/edge-functions/middleware)req.headers.get('user-agent')
of the browser is:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36
However the exception is thrown -
You can use official Vercel example to try it yourself - https://github.com/vercel/examples/blob/main/edge-functions/user-agent-based-rendering/pages/_middleware.ts
The text was updated successfully, but these errors were encountered: