Trouble with empty text after setting up.

I have trouble filling in the text. I have tried many solutions but none of them worked. When I look at the Figma, I can see that the text is on the left panel but is empty. It has proper font but the height of the text is false and there is nothing inside of the text container.

// Create text
      let text = figma.createText();

      // Set a specific font before loading it
      let font = { family: "Open Sans", style: "Regular" };

      (async () => {
        // Move to positions
        text.x = i * horizontalSpacing;
        text.y = i * verticalSpacing - 50;

        // Load the font in the text node before setting the characters
        await figma.loadFontAsync(font);
      })().then(() => {
        text.fontName = font;
        text.characters = `COLOR NAME = ${colorArray[i][0].toUpperCase()}`;

        // Set font size and color
        text.fontSize = 18;
        text.fills = [{ type: "SOLID", color: { r: 5, g: 0, b: 18 } }];

        // Append the text to the page
        figma.currentPage.appendChild(text);
        nodes.push(text);
      });