I have created a basic plugin in magento 2 and also included .css file in correct place as I have seen in many tutorials but when I open frontend page of magento 2(luma page) and do page inspect and in the console after open the issue in tab , it shows :- Unable to resolve the source file for 'frontend/Magento/luma/en_US/Excellence_Hello/css/style.css'
#0 C:\xampp\htdocs\magento\vendor\magento\framework\App\StaticResource.php(97): Magento\Framework\View\Asset\File->getSourceFile()
#1 C:\xampp\htdocs\magento\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\StaticResource->launch()
#2 C:\xampp\htdocs\magento\pub\static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
#3 {main}
what to do to ??? I am also sharing my extension on's link
Best Answer
Wrong directory path in your layout file. You keep css and js both in
view/frontend/web
but in your layout file you mentionedview/frontend/web/css
andview/frontend/web/js
so it will throw above errorin your layout file change source path like below
opinion: This is not a good practice to add js. refer this link to add js