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

fix: allow get_proxied_value to return original value when error #15577

Conversation

crookedneighbor
Copy link
Contributor

closes #15546

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code within packages/svelte/src, add a changeset (npx changeset).

More details in the connected issue, but the TL;DNR version is that when running the dev server, the init_array_prototype_warnings function causes problems with the iframe/JavaScript interactions for 3rd party integrations, such as with Recurly and other payment providers. This is caused because the check for a proxied value involves passing the value to check if it exists within.

By simply wrapping the get_proxied_value function in a try/catch, we avoid the problem of halting the JS run by the 3rd party script on the iframe it controls.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

I intended to write a test for this function, but it appears that the existing proxy test file only runs tests against the proxy function. I can still do that, but it seemed out of keeping with the patterns I see in the code base already.

Copy link

changeset-bot bot commented Mar 21, 2025

🦋 Changeset detected

Latest commit: fcf67ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svelte-docs-bot
Copy link

Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable — thank you!

Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@15577

@Rich-Harris Rich-Harris merged commit d1bd32e into sveltejs:main Mar 21, 2025
8 of 9 checks passed
@github-actions github-actions bot mentioned this pull request Mar 21, 2025
@crookedneighbor
Copy link
Contributor Author

Thanks for the quick review, merge and release! This helps us a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recurly.js Iframes throw security error when running dev server
2 participants