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

Having an empty style tag in a child component throws an error #634

Closed
shancarter opened this issue Jun 12, 2017 · 2 comments
Closed

Having an empty style tag in a child component throws an error #634

shancarter opened this issue Jun 12, 2017 · 2 comments
Labels

Comments

@shancarter
Copy link

shancarter commented Jun 12, 2017

The following nested component:

<style></style>
<p>And this is a nested component.</p>

will throw a Uncaught ReferenceError: add_css is not defined.

https://svelte.technology/repl?version=1.22.2&gist=9b5b0093a02236e4f76ede73027eebf7

If you have whitespace in the style tag of the nested component, all is well:

<style>
</style>
<p>And this is a nested component.</p>

https://svelte.technology/repl?version=1.22.2&gist=5d03bfc1e847d55af76f52db063524b0

@Conduitry Conduitry added the bug label Jun 12, 2017
@Conduitry
Copy link
Member

Yep, thanks, I'd say this is a bug. It happens even without involving child components - compiling just <style></style> will produce code that calls add_css() without defining it. PR coming shortly.

Rich-Harris added a commit that referenced this issue Jun 13, 2017
correctly handle empty <style> tag
@Rich-Harris
Copy link
Member

Thanks, fixed in 1.22.3

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

3 participants