Skip to content
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

URL and its .searchParams not serialized as related in Node v20 #524

Open
overlookmotel opened this issue Oct 9, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@overlookmotel
Copy link
Owner

Input:

const url = new URL('http://foo.com/?x=1&y=2'),
  search = url.searchParams;
export default () => search === url.searchParams;

Output in Node v18.18.0:

const url = new URL("http://foo.com/?x=1&y=2");
export default ((search, url) => () => search === url.searchParams)(
  url.searchParams,
  url
);

This is correct. Function returns true in both original and serialized code.

Output in Node v20.0.0 (and latest v20.8.0):

export default ((search, url) => () => search === url.searchParams)(
  new URLSearchParams("x=1&y=2"),
  new URL("http://foo.com/?x=1&y=2")
);

The exported function here returns false (incorrect).

The problem is due to removal of the Symbol(context) property on URLs in Node v20.0.0, which Livepack relies on to link URLs and their URLSearchParams.

@overlookmotel overlookmotel added the bug Something isn't working label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant