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

Errors if the file contains anonymous template literals #29

Open
jbachhardie opened this issue Jun 3, 2019 · 1 comment
Open

Errors if the file contains anonymous template literals #29

jbachhardie opened this issue Jun 3, 2019 · 1 comment
Labels
🐞 Bug Something isn't working

Comments

@jbachhardie
Copy link

Describe the bug
When a file contains template literals that are not assigned to a variable, Fabulous fails to work with the following error:

TypeError: Cannot read property 'name' of undefined
	at TaggedTemplateExpression (raathigeshan.fabulous-0.10.0\out\extension\file-handlers\js.js:16:38)

To Reproduce
In our codebase, it is failing on styled-components interpolated templates like the following but looking at the file handler it will probably fail for any tagged template that isn't assigned to a variable:

export const SearchCentering = styled.div`
  width: 100%;
  ${mediaMin.xxl`
  margin: 0 auto;
  max-width: 1200px;
  `};
`;

Expected behavior
Tagged templates that aren't defining a styled component should be ignored by Fabulous and the extension should still work.

@Raathigesh Raathigesh added the 🐞 Bug Something isn't working label Jun 3, 2019
@Raathigesh
Copy link
Owner

Thanks for reporting. A partial fix is available in 0.12.0 but still Fabulous doesn't support editing nested template literal as shown in the example but at least it doesn't crash after the error.

Will keep this issue open until we handle nested literals properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants