-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
CF Adapter breaks URL.searchParams #3173
Comments
same problem |
I found a workaround for this: In hooks, create a getSession, and then set all the stuff you need from url in session, then use the session in load:
|
it make some more complexity on another change in frontend if i change the url with goto getsession dosen't call on frontend |
This comment has been minimized.
This comment has been minimized.
+1 on this. This bug is absolutely non spottable/reproducible neither using |
I think this issue actually has to do with binding of url. The url object itself is sent but doesn’t appear to be properly bound which results in the bug in cf pages. |
Same with accessing pathname on the url object. Cloudflare shows a 500 with: Using hooks works, but this still really sucks. |
This comment has been minimized.
This comment has been minimized.
Another workaround a bit less intrusive: In hooks, handle(): request.locals.fixedUrl = request.url.toJSON(); In hooks, getSession(): return {
fixedUrl: locals.fixedUrl
}; In the export async function load({ session }) {
const url = new URL(session.fixedUrl);
} |
Can you check if this is still happening with the latest versions of everything? 'method called on incompatible receiver' makes me think this is proxy-related — we used to use a proxy indiscriminately to prevent illegal query access during prerendering, but as of #3314 we only create the proxy when prerendering is true |
With the latest version of |
It now works for me on SvelteKit version Thanks a lot! |
One second, let me test |
Describe the bug
Method searchParams called on incompatible receiver [object Object]
TypeError: Method searchParams called on incompatible receiver [object Object]
Reproduction
This code will give:
Method searchParams called on incompatible receiver [object Object]
TypeError: Method searchParams called on incompatible receiver [object Object]
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: