0

I have integrated the Example module in my Sulu-standard installation. The code I used for the example module is from following repository :

https://github.com/sulu/ExampleNewsBundle

And the steps I followed for integration are from this

http://blog.sulu.io/how-to-develop-a-bundle-in-the-sulu-admin-1

After the installation I am getting this error while loading the JS for the module :

"NetworkError: 404 Not Found - http://beauty_dev.com/en/bundles/examplenews/js/main.js?v=develop" 
Error: Script error for: /bundles/examplenews/js/main.js http://requirejs.org/docs/errors.html#scripterror
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
Error: Script error for: /bundles/examplenews/js/main.js http://requirejs.org/docs/errors.html#scripterror
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

After some research I found that 404 error was due to locale(en) appended in the URL.

Is it possible to remove the locale from the URL?

Any reference will be appreciated.

2 Answers2

0

After adding a new bundle you have to reinstall the assets using the following command:

app/console assets:install --symlink

Symfony doesn't do that automatically, so you have to execute this line, in order for the files to be copied to the web directory. You could also check if the accessed file is available in the web directory, which should be the case after executing the above command.

Regarding the language: You see that because Sulu tries to redirect to the default language if the current URL leads to a 404 and doesn't contain a language.

Daniel Rotter
  • 1,998
  • 2
  • 16
  • 33
  • Thanks for the reply, I used the command but still same issue. Its specifically calling the **/en/bundles/examplenews** – tejashsoni111 May 23 '16 at 11:19
0

Are you sure that the files in the web/bundles/examplenews folder exists and you can access from the browser? When the files exists and the webserver returns them correctly the /de will not be prepended.