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
I encountered an issue with SWC when compiling code that contains strings with double backslashes. It seems this problem only occurs when "target": "es2018" is set and compress is enabled. This problem will cause components as react-katex or other web latex library output weird results.
It seems this problem dose not occur in v1.3.1, and occurs in v.1.5.3 and above.
ayanamists
changed the title
SWC incorrectly handles double backslashes in string template
SWC incorrectly handles double backslashes in template literals
May 7, 2024
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
I encountered an issue with SWC when compiling code that contains strings with double backslashes. It seems this problem only occurs when
"target": "es2018"
is set and compress is enabled. This problem will cause components asreact-katex
or other web latex library output weird results.It seems this problem dose not occur in v1.3.1, and occurs in v.1.5.3 and above.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.5.3&code=H4sIAAAAAAAAA13K0QpAMBQG4PvzFH%2B7svIG8g4eQLHNhLKxnUnJu1Nu8F1%2Fdl98YPTJGR69QzPFPVM5tMRBuAXLKTjogk4i%2B2zjXWQolE8Xs%2BJB5Ggr1PXWqThgbeU3638Wrywk0QXDQon6iQAAAA%3D%3D&config=H4sIAAAAAAAAA41VwW7bMAy99ysCn3dodyiKfcBu%2BwZBsShHmSwaIpUmKPLvo2U7TRva2CWI%2BfRIkXykPp52u%2BZIbfNr9yF%2F5WOwmSDfvsVCl8T2LJYG2t5Sm8PAzY8FPdIIeRsJquk6IQ3b3AFXFv18fnmbGU1EJFgYs60PKfjLfcwW%2ByED0Z1NrOKy9JCYvvJnLOP7CHAu9%2FY9YgSbNhBjyYTE0EHWHLcYox0IzMlmxct4U5sDoRZiBAuDM0PGQcWTCxwwScxH1IF1pkUHChQytBxOoNEkltASSXpKPhV2sC9dV%2Fv8jQ0nG4tlJSaca0vktorXAwZi40vSSjiBKzWYwLm435nBmwxccnrkHTGklZ78BZAKREuUbA%2Ba33rCi57W2H6TGZIXyfJFwUXfWpYJOimqCcErlR0rA5mD1s0MrrQwVrbVrjPDK%2BWj4MCA96IVxTW9B24PWlC%2BDIBeAaS%2F1muqmgBzm8IVfByIDfi3ZMm6wOYTveXDOkqXfo9xI0APfEC3cUBawbgOZ9kS52EdL8mBSAOceqRQBR6XgAwAo4l1Xz5oQ8ZDPJou4v5zTcwHrrc93NvU1Xm%2F25eMQ4QTxDUZ%2F8eIbKJyt9Oo6mWyH6YX3jRRWhm88PL85dmQVJ6W35pU06MrdwlVTU7PyWvzeWh5OZaqNYH%2BLMTJdv0H%2FO0MreQGAAA%3D
SWC Info output
Expected behavior
The output should be
Actual behavior
The output is
Note the
\\\vdash
here, this is incorrect.Version
1.5.3
Additional context
No response
The text was updated successfully, but these errors were encountered: