Skip to content

Area code not set: Area code must be set before starting a session. #1

Description

@dawhoo

helper/data.php

change line 69 to \Magento\Framework\Url $frontUrlModel,

add line below 69 \Magento\Framework\App\State $state)

after parent::__construct($context);

add line $state->setAreaCode('frontend'); // or 'adminhtml', depending on your needs

This will resolve not being able to execute commands in CLI on Magento 2.2.1

Never done this before so I hope this is the proper format.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions