2

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

Bilal Usean
10.2k14 gold badges77 silver badges126 bronze badges
asked Sep 3, 2016 at 7:29

1 Answer 1

3

Wrong directory path in your layout file. You keep css and js both in view/frontend/web but in your layout file you mentioned view/frontend/web/css and view/frontend/web/js so it will throw above error

in your layout file change source path like below

<css src="Excellence_Hello::style.css"/>
<script src="Excellence_Hello::style.js"/>

opinion: This is not a good practice to add js. refer this link to add js

answered Sep 3, 2016 at 8:09
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.