thecodeholic / Yii2-Youtube-Clone

Youtube clone made with Yii2 framework
https://youtu.be/whuIf33v2Ug
BSD 3-Clause "New" or "Revised" License
129 stars 77 forks source link

getting this error at 2:42:12 in tutorial while clicking the open video link #3

Open Himanshu-portfolio opened 3 years ago

Himanshu-portfolio commented 3 years ago

An Error occurred while handling another error: ReflectionException: Class yii\bootstrap\BootstrapAsset does not exist in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php:508 Stack trace:

0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(508): ReflectionClass->__construct('yii\bootstrap\B...')

1 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(386): yii\di\Container->getDependencies('yii\bootstrap\B...')

2 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(171): yii\di\Container->build('yii\bootstrap\B...', Array, Array)

3 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\BaseYii.php(365): yii\di\Container->get('yii\bootstrap\B...', Array, Array)

4 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(264): yii\BaseYii::createObject(Array)

5 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(237): yii\web\AssetManager->loadBundle('yii\bootstrap\B...', Array, true)

6 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(287): yii\web\AssetManager->getBundle('yii\bootstrap\B...')

7 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(292): yii\web\View->registerAssetBundle('yii\bootstrap\B...', NULL)

8 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetBundle.php(125): yii\web\View->registerAssetBundle('frontend\assets...')

9 G:\WAMP64\www\Youtube-Clone\frontend\views\layouts\main.php(13): yii\web\AssetBundle::register(Object(yii\web\View))

10 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(348): require('G:\WAMP64\www\Y...')

11 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(257): yii\base\View->renderPhpFile('G:\WAMP64\www\Y...', Array)

12 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(425): yii\base\View->renderFile('G:\WAMP64\www\Y...', Array, Object(frontend\controllers\SiteController))

13 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(411): yii\base\Controller->renderContent('<div class="sit...')

14 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(139): yii\base\Controller->render('error', Array)

15 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(118): yii\web\ErrorAction->renderHtmlResponse()

16 [internal function]: yii\web\ErrorAction->run()

17 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Action.php(94): call_user_func_array(Array, Array)

18 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\Action->runWithParams(Array)

19 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('error', Array)

20 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorHandler.php(109): yii\base\Module->runAction('site/error')

21 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\ErrorHandler.php(135): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))

22 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))

23 {main}

Next yii\di\NotInstantiableException: Failed to instantiate component or class "yii\bootstrap\BootstrapAsset". in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php:510 Stack trace:

0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(386): yii\di\Container->getDependencies('yii\bootstrap\B...')

1 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\di\Container.php(171): yii\di\Container->build('yii\bootstrap\B...', Array, Array)

2 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\BaseYii.php(365): yii\di\Container->get('yii\bootstrap\B...', Array, Array)

3 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(264): yii\BaseYii::createObject(Array)

4 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetManager.php(237): yii\web\AssetManager->loadBundle('yii\bootstrap\B...', Array, true)

5 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(287): yii\web\AssetManager->getBundle('yii\bootstrap\B...')

6 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\View.php(292): yii\web\View->registerAssetBundle('yii\bootstrap\B...', NULL)

7 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\AssetBundle.php(125): yii\web\View->registerAssetBundle('frontend\assets...')

8 G:\WAMP64\www\Youtube-Clone\frontend\views\layouts\main.php(13): yii\web\AssetBundle::register(Object(yii\web\View))

9 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(348): require('G:\WAMP64\www\Y...')

10 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\View.php(257): yii\base\View->renderPhpFile('G:\WAMP64\www\Y...', Array)

11 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(425): yii\base\View->renderFile('G:\WAMP64\www\Y...', Array, Object(frontend\controllers\SiteController))

12 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(411): yii\base\Controller->renderContent('<div class="sit...')

13 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(139): yii\base\Controller->render('error', Array)

14 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorAction.php(118): yii\web\ErrorAction->renderHtmlResponse()

15 [internal function]: yii\web\ErrorAction->run()

16 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Action.php(94): call_user_func_array(Array, Array)

17 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\Action->runWithParams(Array)

18 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('error', Array)

19 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\ErrorHandler.php(109): yii\base\Module->runAction('site/error')

20 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\ErrorHandler.php(135): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))

21 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))

22 {main}

Previous exception: yii\base\InvalidRouteException: Unable to resolve the request "/storage/videos/d0qSe90p.mp4". in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Module.php:537 Stack trace:

0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\Application.php(104): yii\base\Module->runAction('/storage/videos...', Array)

1 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))

2 G:\WAMP64\www\Youtube-Clone\frontend\web\index.php(17): yii\base\Application->run()

3 {main}

Next yii\web\NotFoundHttpException: Page not found. in G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\web\Application.php:116 Stack trace:

0 G:\WAMP64\www\Youtube-Clone\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))

1 G:\WAMP64\www\Youtube-Clone\frontend\web\index.php(17): yii\base\Application->run()

2 {main}

lopeshelder commented 3 years ago

@Kingwrites I think it's because you're calling "yii\bootstrap\BootstrapAsset" on your dependencies on AppAsset.php... Try replacing it to "yii\bootstrap4\BootstrapAsset"...

Hope this fixes your issue! ;)

Himanshu-portfolio commented 3 years ago

I already done this but doesn't work

On Wed, 16 Dec, 2020, 7:45 pm lopeshelder, notifications@github.com wrote:

@Kingwrites https://github.com/Kingwrites I think it's because you're calling "yii\bootstrap\BootstrapAsset" on your dependencies on AppAsset.php... Try replacing it to "yii\bootstrap4\BootstrapAsset"...

Hope this fixes your issue! ;)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thecodeholic/Yii2-Youtube-Clone/issues/3#issuecomment-746354589, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBIDPFD6XSPUN65HKZFNDDSVC6GTANCNFSM4UITMS2A .

lopeshelder commented 3 years ago

Have you replaced it on both frontend and backend? Also, see the if you have your frontend url on params ending with '/'... if so, i think you can remove the one in front of '/storage/videos/'.$this->video_id.'.mp4'

Let me know if this fixes it...

KongVannak1503 commented 5 months ago

Database Exception – yii\db\Exception SQLSTATE[42S22]: Column not found: 1054 Unknown column 'create_by' in 'where clause' The SQL being executed was: SELECT * FROM video WHERE create_by=2 ORDER BY created_at DESC LIMIT 1 Error Info: Array ( [0] => 42S22 [1] => 1054 [2] => Unknown column 'create_by' in 'where clause' ) ↵ Caused by: PDOException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'create_by' in 'where clause' in C:\xampp\htdocs\pos-admin\vendor\yiisoft\yii2\db\Command.php at line 1320. i clone your but it's always show this