From faf5a55100831a1b39eea67968b15c9ac7e894d0 Mon Sep 17 00:00:00 2001 From: feugy Date: Wed, 12 Jun 2024 09:46:43 +0200 Subject: [PATCH 1/2] fix(#56,#72): useSearchParams might return null and break script insertion --- packages/web/src/nextjs/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/src/nextjs/utils.ts b/packages/web/src/nextjs/utils.ts index ef08210..d794632 100644 --- a/packages/web/src/nextjs/utils.ts +++ b/packages/web/src/nextjs/utils.ts @@ -5,7 +5,7 @@ import { computeRoute } from '../utils'; export const useRoute = (): string | null => { const params = useParams(); - const searchParams = useSearchParams(); + const searchParams = useSearchParams() || new URLSearchParams(); const path = usePathname(); const finalParams = { From d8dca301d6151bc2655305d3e4b90775c8f160d2 Mon Sep 17 00:00:00 2001 From: feugy Date: Wed, 12 Jun 2024 09:51:46 +0200 Subject: [PATCH 2/2] chore: version bump --- packages/web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/package.json b/packages/web/package.json index 97f6a89..0ac251b 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@vercel/speed-insights", - "version": "1.0.11", + "version": "1.0.12", "description": "Speed Insights is a tool for measuring web performance and providing suggestions for improvement.", "keywords": [ "speed-insights",