docker icon indicating copy to clipboard operation
docker copied to clipboard

docker compose build fails with Type error: 'searchParams' is possibly 'null'.

Open neuhaus opened this issue 1 year ago • 2 comments

I did a fresh git clone and tried to build the docker container according to the instructions but it fails:

   Linting and checking validity of types ...
Failed to compile.

../../packages/features/ee/event-tracking/lib/posthog/web/PostHogPageView.tsx:15:11
Type error: 'searchParams' is possibly 'null'.

  13 |     if (pathname && posthog) {
  14 |       let url = window.origin + pathname;
> 15 |       if (searchParams.toString()) {
     |           ^
  16 |         url = `${url}?${searchParams.toString()}`;
  17 |       }
  18 |       posthog.capture("$pageview", {
The command '/bin/sh -c yarn --cwd apps/web workspace @calcom/web run build' returned a non-zero code: 1

neuhaus avatar Nov 06 '24 15:11 neuhaus

i guess changing line 15 to if (searchParams?.toString()) { will fix the issue?

neuhaus avatar Nov 06 '24 16:11 neuhaus

i guess changing line 15 to if (searchParams?.toString()) { will fix the issue?

Yes, worked for me!

mabdelfattah avatar Nov 12 '24 06:11 mabdelfattah

This was fixed in cal.com core via this PR. Closing.

dcharles525 avatar Aug 22 '25 02:08 dcharles525