js-url-gen icon indicating copy to clipboard operation
js-url-gen copied to clipboard

createCloudinaryURL breaks SSR

Open robdixon-netc opened this issue 1 year ago • 3 comments

Since when using version 1.10.0 we were seeing the following error when trying to use SSR:

JsRuntimeException: ReferenceError: URLSearchParams is not defined
at createCloudinaryURL (server.js:2:339702) -> …URI(i).replace(/\?/g,"%3F").replace(/=/g,"%3D"),n=new URLSearchParams(this.urlConfig.queryParams);!1…
at toURL (server.js:2:341974)
at Ld (server.js:2:349424)
at SplitContent (server.js:2:575857)
at i (server.js:2:28626)
at server.js:2:29644
at t.render (server.js:2:29677)
at t.read (server.js:2:27548)
at t.renderToString (server.js:2:34395)
at Script [4]:1:16

Reverting back to 1.9.2 resolves the issue

robdixon-netc avatar Apr 27 '23 11:04 robdixon-netc

Hi Rob. Danny from Cloudinary here.

Thanks for flagging this. Could you please tell us what framework you're using for SSR, as well as any versions that might be relevant? If you're able to create a sample repo that allows us to quickly reproduce this error, that would be helpful also.

Thanks!

dannyv-cloudinary avatar Apr 27 '23 13:04 dannyv-cloudinary

Hi Danny,

Thanks for responding. It's using reactjs.net, the latest version.

Thanks, Rob

robdixon-netc avatar Apr 27 '23 15:04 robdixon-netc

Hi @robdixon-netc ,

Thanks for your response. I am unable to recreate the issue with 1.10.0 .

Can you please provide your code using codesandbox (https://codesandbox.io/)? If you cannot share your code here, please create a support ticket: https://support.cloudinary.com/hc/en-us

Best Regards, Sree

skalahasti-cloudinary avatar Apr 27 '23 23:04 skalahasti-cloudinary