Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • For CLI command it is good to set Global area code instead of Frontend $this->appState->setAreaCode(\Magento\Framework\App\Area::AREA_GLOBAL); Commented Oct 16, 2023 at 10:01
  • Yes if i set AREA_GLOBAL or AREA_ADMINHTML then also it gives the same error. Commented Oct 16, 2023 at 10:06
  • try to put code into the try-catch & finally. Commented Oct 16, 2023 at 10:12
  • In which file you write above code? Commented Oct 16, 2023 at 10:18
  • @Harishkuril already added. Commented Oct 16, 2023 at 10:37