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

Bowser crashes in Next.js Middleware Functions #512

Closed
voronianski opened this issue Apr 27, 2022 · 1 comment · Fixed by #516
Closed

Bowser crashes in Next.js Middleware Functions #512

voronianski opened this issue Apr 27, 2022 · 1 comment · Fixed by #516
Assignees

Comments

@voronianski
Copy link
Contributor

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 -

error - (middleware)/node_modules/bowser/src/parser.js (95:0) @ eval
Error: Browser's test function is not valid

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

@bingoYB
Copy link

bingoYB commented Oct 18, 2022

I'm having the same problem, so when can this PR be merged.

@naorpeled naorpeled self-assigned this Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants