fix: #3591072 getFallbackCompiledJs() returns malformed JS
Fixes syntax of fallback output when code component could not be compiled in Canvas code editor.
Testing
- create a code component with invalid JS, e.g.,
export default function(, save it and add it to the library - add the component to a page and save changes
- open the page and verify that there is a js syntax error reported in the browser console
- apply changes from this MR, rebuild the ui (
npm run build -w ui), clear cache - save some changes to the component while keeping its js invalid, e.g.,
export default function(., save changes - open the page and verify that the js syntax error is no longer reported in the browser console and that in the place where the invalid component should be placed, there is an html comment with
<!-- The component <component-name> failed to compile. -->
Closes #3591072
Edited by wotnak