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

{@html ...}<tag> fails with NoModificationAllowedError #3326

Closed
Lonami opened this issue Jul 31, 2019 · 2 comments
Closed

{@html ...}<tag> fails with NoModificationAllowedError #3326

Lonami opened this issue Jul 31, 2019 · 2 comments
Labels

Comments

@Lonami
Copy link

Lonami commented Jul 31, 2019

Describe the bug
Attempting to write the following:

<p>{@html foo}<br>bar</p>

Will fail with (under Firefox):

NoModificationAllowedError: Modifications are not allowed for this document

However, adding whitespace after the } makes the error disappear, such as a newline or just a space:

<p>{@html foo} <br>bar</p>

Logs

NoModificationAllowedError: Modifications are not allowed for this document (bundle.js:1)

To Reproduce
Please paste the following code into https://svelte.dev/repl:

<script>
	let foo = 'foo<br>bar';
</script>

<p>{@html foo}<br>baz</p>

Expected behavior
It should work, as if I had written the space after the }.

Information about your Svelte project:

  • Firefox 68.0.1 (64-bit)
  • Linux Mint 19.1 Tessa x86_64, kernel 4.15.0-55-generic
  • Svelte version 3.0.0
  • Using Webpack

Severity
Low, but can trip other people.

Additional context
Loving this frameless framework :)

@Code0987
Copy link

Code0987 commented Aug 1, 2019

Adding to your bug,
With <p>{@html string}<span>More text!</span></p>
Gives Failed to execute 'insertAdjacentHTML' on 'Element': The element has no parent.
And works normally if I add space after }.

In Chrome 75 / MacOS

@Rich-Harris
Copy link
Member

Fixed in 3.7.0 — thanks

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

No branches or pull requests

4 participants