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

Unable to handle @ in attribute values since Svelte v3.12.0 #3545

Closed
antony opened this issue Sep 10, 2019 · 9 comments · Fixed by #3546
Closed

Unable to handle @ in attribute values since Svelte v3.12.0 #3545

antony opened this issue Sep 10, 2019 · 9 comments · Fixed by #3546
Assignees
Labels

Comments

@antony
Copy link
Member

antony commented Sep 10, 2019

Describe the bug
It seems that after upgrading to Svelte 3.12.0, using an @ in an attribute value causes a compiler error on the client.

This works as expected in 3.11.0

Logs

> [email protected] dev /home/ant/Projects/martin-clunes
> sapper dev

✗ client
compiler error: this shouldn't happen! generated code is trying to use inexistent internal 'martin_clunes'
✔ server (846ms)
✔ service worker (439ms)
> Listening on http://localhost:3003

To Reproduce
https://github.com/beyonk-adventures/sapper-attribute-issue

Expected behavior
The bundle should compile correctly.

Information about your Sapper Installation:

  • Sapper 0.27.0+

  • Svelte 3.12.0

  • Dynamic application

  • Rollup (haven't tried webpack)

Severity
It's annoying and broken, but can be worked around temporarily.

Additional context
This only occurs in Sapper projects, yet occurs on the client-side build.

@Conduitry
Copy link
Member

This is almost certainly a bug in Svelte and not in Sapper, although I'm not sure why I'm having trouble reproducing it with Svelte alone. Moving the issue to the Svelte repo.

@Conduitry Conduitry transferred this issue from sveltejs/sapper Sep 10, 2019
@Conduitry Conduitry added the bug label Sep 10, 2019
@Conduitry
Copy link
Member

Whoops, I was thinking in a box. This reproduces it in the REPL, when compiled with dev mode on:

<Foo bar="@baz">
</Foo>

The reference to this.comment here needs to have @ sigils escaped, like it does down here.

@Conduitry
Copy link
Member

I should've written a test when I fixed this the first time in #3186, maybe then this wouldn't have snuck through 😬

@antony
Copy link
Member Author

antony commented Sep 10, 2019

@Conduitry wow - I reviewed all the commits and I didn't spot this :)

@Conduitry
Copy link
Member

Fixed in 3.12.1.

@jhwheeler
Copy link

@Conduitry This still happens for me, even after updating to 3.12.1. Could it be because Sapper still uses 3.6.9?

@Conduitry
Copy link
Member

The devdependency of "svelte": "^3.6.9" in Sapper won't have any effect on what version of Svelte it's using in your installation. What does running npm ls svelte display?

@jhwheeler
Copy link

We're using 3.12.1.

@Conduitry
Copy link
Member

If you have a small repro, please open a new issue with it.

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

Successfully merging a pull request may close this issue.

3 participants