AppAsset Directory Does not exist

I am trying to set up frontend environment I tried making AppAsset under frontend/assets
and it shows:

Invalid Configuration – yii\base\InvalidConfigException

The directory does not exist:



namespace frontend\assets;

use yii\web\AssetBundle;

class AppAsset extends AssetBundle
    public $basePath = "@webroot";
    public $baseUrl = "@web";
    public $css = [
        YII_ENV_DEV ?
            "node_modules/bootstrap/dist/css/bootstrap.css" :
    public $js = [
        YII_ENV_DEV ?
            "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" :
    public $depends = [

in my layout/main.php:
<?php /** @var \yii\web\View $this */ /** @var string $content */ use frontend\assets\AppAsset; use yii\helpers\Html; ?> <?php AppAsset::register($this); ?>

I am trying to To Register The AppAsset in layout/main.php


What exactly is happening I tried Making new Advanced App from scratch and it worked just fine but now I am forced to work in the company project so I have no choice but to make it work Please Help.

Paste full stack trace as text here

There should be an additional ‘assets’ folder in your web folder that is writable by the application. This is where it publishes the assets that you have created so that the application can display them.


Thanks For that I realized that When I compared the 2 different Directory of the Projects

1 Like

Thanks for Commenting it means alot :hearts:.
I just thought that Yii was the one responsible for creating folder called assets because I got confused from the multiple assets directories in frontend and backend I solved it.