workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: new URL fails sometimes in pages function

Open DianomiJH opened this issue 2 years ago • 1 comments

Which Cloudflare product(s) does this pertain to?

Pages, Workers Runtime

What version(s) of the tool(s) are you using?

wrangler 2.19.0

What version of Node are you using?

16.13.1 (tried lts and 20.x.x too)

What operating system are you using?

Mac

Describe the Bug

when running cloudflare pages functions locally with wrangler pages dev, this code works fine:

  try {
    const urlString =
      'https://ad.doubleclick.net/ddm/trackclk/N6540.160898.DIANOMI/B29713929.364450846;dc_trk_aid=555323610;dc_trk_cid=189882172;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;ltd=?https://www.nomuraconnects.com/focused-thinking-posts/the-economy-next-week/?utm_source=dianomi&utm_medium=content&utm_campaign=emea+2023-2024+ph11&utm_content=%erid!&utm_term=%epid!_:pub_name';
    console.log(urlString);
    const url = new URL(urlString);
    console.log(url)
  } catch (e) {
    console.error(e);
  }

But when deployed to cloudflare pages it fails and hits the catch.

I know it's a weird URL, but it seems to work in all node versions I tried, and all the major browsers.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

DianomiJH avatar Sep 11 '23 10:09 DianomiJH

@DianomiJH thank you for filing this issue and sorry for the delayed response. Are you able to replicate this with Wrangler v3?

admah avatar Feb 26 '24 16:02 admah

hey @DianomiJH :) we haven't heard from you so we’re going to close this issue for now, but if this is still a problem, please feel free to open a new issue referencing this one. please be sure to include an updated summary and any additional requested details, followup, or context and we will revisit and investigate further. thanks!

lrapoport-cf avatar Mar 11 '24 14:03 lrapoport-cf