Can't load js file in bundle #17715
-
Loading failed for the <script> with the source ‘http://localhost/admin/bundles/Divae/ProductImporterBundle/public/js/pimcore/startup.js’. The location of the bundle is /bundles/Divae/ProductImporterBundle/ I have done everything as described in the documentation. I created the bundle with the bundle generator. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Please show the code where you register the file. The path is wrong. |
Beta Was this translation helpful? Give feedback.
-
I have changed the path: Loading failed for the <script> with source “http://localhost/bundles/Divae/src/ProductImporterBundle/Resources/public/js/startup.js”. service.yaml
AdminAssetListener
ProductImporterBundel
|
Beta Was this translation helpful? Give feedback.
The assets need to be in the
public
folder of your project (the “web root”) otherwise you can't easily access them via the browser.This happens by running
console assets:install
(in dev mode, preferably also with the--symlink --relative
flags, because otherwise you have to call it again after each change).This copies (or symlinks) everything from
bundles/Divae/src/ProductImporterBundle/Resources/
(if this is where your bundle lives) topublic/bundles/divaeproductimporter/
(the last part depends on your actual bundle name, so I just made a guess — please take a look into yourpublic/bundles/
folder if it is right).And this is the path you must also use in your
AdminAssetListener
orPro…