question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ts-styled-plugin` error on valid referred component template literal curly brace

See original GitHub issue

From @awwong1 on July 13, 2018 22:55

Hello, I’m seeing ts-styled-plugin errors while using this plugin (version 0.0.21) and referred components in my application.

I have verified that my code compiles and renders in the browser without issues.

I see the following errors around the two curly braces after the referred component selector.

const ListNoteTitle = styled.span`
  font-weight: bold;
  color: ${props => props.theme.primaryColor};
  ${ListNoteItem}:hover & {
    text-decoration: underline;
  }
`;

screenshot from 2018-07-13 16-49-20

  • [ts-styled-plugin] semi-colon expected on the first curly brace
  • [ts-styled-plugin] at-rule or selector expected on the second curly brace

I think this is a plugin issue. My relevant source code can be found here:

Copied from original issue: styled-components/vscode-styled-components#117

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
protoEvangelioncommented, Nov 11, 2018

@mjbvz Still getting this in a similar example:

<Component animation={css`${condition ? animation1 : animation2} 1s linear`} />

image

image

3reactions
akc42commented, Oct 13, 2018

I just upgraded to September edition of vscode (on linux) and now get this too

screenshot from 2018-10-13 16-26-14

the second problem at the bottom says semi-colon expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to escape quotation marks and curly brackets in template ...
My plan is to use a template string to change it, whenever the variable currentLang changes. The problem is, that I can't escape...
Read more >
Template literals in JavaScript | Laurie on Tech
The above code isn't valid. In order to use that string literal, you have to surround it with curly braces. <Component name ...
Read more >
Documentation - TypeScript 3.9
So TypeScript users will get a helpful red squiggle and an error message when ... in a function, especially when adding curly braces...
Read more >
TypeScript errors and how to fix them
Fixed Code ✔️. This error is similar to TS1002 but refers to the ending of a template literal. To fix it, we have...
Read more >
Learn Template Strings – ES6: The Right Parts
Templates Strings are an alternative to string concatenation. ... So if you wanted to do a dollar sign curly brace that wasn't part...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found