You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CSS in JS crashes with variable wrapped in quotes #5219
Error: Couldn't insert all the expressions
attransformCssDoc(https://prettier.io/lib/standalone.js:22171:11)atObject.embed$4[asembed](https://prettier.io/lib/standalone.js:22011:18)atObject.printSubtree(https://prettier.io/lib/standalone.js:15781:31)atcallPluginPrintFunction(https://prettier.io/lib/standalone.js:15898:29)at https://prettier.io/lib/standalone.js:15863:16atObject.printComments(https://prettier.io/lib/standalone.js:15586:17)atprintGenerically(https://prettier.io/lib/standalone.js:15862:22)atFastPath.call(https://prettier.io/lib/standalone.js:15700:16)atprintPathNoParens(https://prettier.io/lib/standalone.js:25178:91)atObject.genericPrint$3[asprint](https://prettier.io/lib/standalone.js:23541:28)
Expected behavior:
For Prettier not to crash 😅
This is a reduced example, real world case is a @font-face declaration. I do think the quotes are not necessary, but Prettier shouldn't crash, it's valid CSS
Possibly related: I get the same error when I have too many interpolations in my Styled Components I'm trying to format.
In this Playground link, remove one interpolation block to successfully output prettified code. The syntax inside the blocks is identical, so it's just the number of interpolation blocks that causes the crash.
Activity
SimenB commentedon Feb 11, 2019
Still an issue in 1.16 (updated the OP)
StephenHaney commentedon May 25, 2019
Possibly related: I get the same error when I have too many interpolations in my Styled Components I'm trying to format.
In this Playground link, remove one interpolation block to successfully output prettified code. The syntax inside the blocks is identical, so it's just the number of interpolation blocks that causes the crash.
Playground Link
fisker commentedon Nov 4, 2019
minimum reproduction
Prettier 1.18.2
Playground link
Input:
Output:
alexander-akait commentedon Nov 5, 2019
We should migrate from
postcss-lessfor styled in favor https://github.com/gucong3000/postcss-jsx