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

Fix compatibility with Next.js middleware #516

Merged
merged 2 commits into from
Nov 13, 2023
Merged

Fix compatibility with Next.js middleware #516

merged 2 commits into from
Nov 13, 2023

Conversation

connor-baer
Copy link
Contributor

Fixes #512.

@zeckdude
Copy link

@lancedikson @voronianski Can we get this merged please? We rely heavily on your package in multiple places and would really love for our browser parsing to be the same in the Next.js middleware.

@zeckdude
Copy link

@connor-baer Thanks for the fix! I forked it and tested it and it looks like your solution needs to be applied on 4 more areas in the parser.js file where the instanceOf method is being used cause those are still currently not realizing that the test is an array.

@voronianski You may want to request changes so that gets addressed before merging.

Copy link

@zeckdude zeckdude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix to change the method to detect the array needs to be applied in 4 places for it to work in the Next.js middleware. Can you please make that fix?
Screen Shot 2022-07-11 at 4 55 17 PM

@connor-baer
Copy link
Contributor Author

Good catch, @zeckdude!

I think these code paths weren't reached in my testing, so the initial fix worked for my use case. Makes absolute sense to fix it everywhere though!

@zeckdude
Copy link

Vielen Dank!

@bingoYB
Copy link

bingoYB commented Oct 18, 2022

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

@mkkhedawat
Copy link

Hey folks, I had forked https://github.com/mkkhedawat/frowser from this project recently given the inactivity from maintainer here. Would love to have this included in PR there if that is of interest.

@naorpeled naorpeled merged commit b86bce1 into bowser-js:master Nov 13, 2023
@connor-baer connor-baer deleted the patch-1 branch November 13, 2023 09:43
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 this pull request may close these issues.

Bowser crashes in Next.js Middleware Functions
6 participants