<commit_before>import { document } from 'global';
import { stripIndents } from 'common-tags';

const rootEl = document.getElementById('root');
let currLoadedComponent = null; // currently loaded marko widget!

export default function renderMain({ story, selectedKind, selectedStory, showMain, showError }) {
  const element = story();

  // We need to unmount the existing set of components in the DOM node.
  if (currLoadedComponent) {
    currLoadedComponent.destroy();
  }

  if (!element || !element.out) {
    showError({
      message: `Expecting a Marko element from the story: "${selectedStory}" of "${selectedKind}".`,
      stack: stripIndents`
        Did you forget to return the Marko element from the story?
        Use "() => MyComp.renderSync({})" or "() => { return MyComp.renderSync({}); }" when defining the story.
      `,<commit_msg>fix error message for marko component error<commit_after>import { document } from 'global';
import { stripIndents } from 'common-tags';

const rootEl = document.getElementById('root');
let currLoadedComponent = null; // currently loaded marko widget!

export default function renderMain({ story, selectedKind, selectedStory, showMain, showError }) {
  const element = story();

  // We need to unmount the existing set of components in the DOM node.
  if (currLoadedComponent) {
    currLoadedComponent.destroy();
  }

  if (!element || !element.out) {
    showError({
      title: `Expecting a Marko element from the story: "${selectedStory}" of "${selectedKind}".`,
      description: stripIndents`
        Did you forget to return the Marko element from the story?
        Use "() => MyComp.renderSync({})" or "() => { return MyComp.renderSync({}); }" when defining the story.
      `,
{'fraction_non_alphanumeric': 0.12284730195177956, 'fraction_numerical': 0.0, 'mean_word_length': 3.9376770538243626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '351955', 'n_tokens_mistral': 472, 'n_tokens_neox': 463, 'n_words': 172}