1

Using this tutorial, I'm trying to get the Symfony2 CMF up and running. I was able to get the framework off the ground, but none of the styles or scripts are loading. I'm getting the errors for the js and css:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/3428277_bootstrap.min_1.css". en:14
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/06935bc_font-awesome_3.css". en:32
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/3428277_style_3.css". en:28
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/06935bc_create-ui_2.css". en:31
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/06935bc_tags_1.css". en:30
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/3428277_bootstrap-responsive.min_2.css". en:21
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/06935bc_overlay_7.css". en:36
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/06935bc_createStyle_6.css". en:35
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/06935bc_midgardnotif_4.css". en:33
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_jquery_1.js". en:283
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_jquery-ui_2.js". en:284
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://cmf.local/app_dev.php/css/06935bc_halloCmfStyle_5.css". en:34
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_underscore_3.js". en:285
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_rangy-core_5.js". en:287
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_vie_6.js". en:288
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_backbone_4.js". en:286
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_jquery.rdfquery.core_7.js". en:289
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_jquery.rdfquery.rules_8.js". en:290
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_annotate_10.js". en:292
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_create_11.js". en:293
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/create_jquery.tagsinput_9.js". en:291
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/ckeditor_ckeditor_1.js". en:297
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/ckeditor_init-create-ckeditor_2.js". en:298
Resource interpreted as Script but transferred with MIME type text/html: "http://cmf.local/app_dev.php/js/ckeditor_init-create-common_3.js". 

These styles and scripts are loading from skeleton.html.twig:

{% stylesheets
    ...             
    <link rel="stylesheet" href="{{ asset_url }}" media="screen" type="text/css"/>
 {% endstylesheets %}

and

{% block bottom_scripts %}
            {% render(controller("cmf_create.jsloader.controller:includeJSFilesAction", { "editor": "ckeditor", "_locale": app.request.locale })) %}
{% endblock %}

From the tutorial, these styles should load up fine. I have also used the CMF docs here, and could get styles loaded, but ran into a lot of other issues with the documentation. Is there something I need to tweak in my config.yml maybe?

UPDATE

This appears to be an issue with assetic. If I manually load the styles into skeleton.html.twig, they appear.

Any reason why assetic would cause this mime type transfer? Some setting I dont have correct in this massive framework?

Carey Estes
  • 1,534
  • 2
  • 31
  • 59
  • this looks like either you have a strange configuration in your apache server that makes it change the mime type, or a very basic assetic problem which seems unlikely. OR: did you open any of those urls? maybe there is a symfony error message in the files and not really css/js (because assetic is misconfigured or missing something...) – dbu Jan 16 '14 at 09:02
  • I don't think it's apache, because Ive been able to get other CMF installations up, and I don't have this problem on any other symfony2 site on my local. If I open the urls, the styles show up, no symfony error. If I wanted to check apache, what setting am I looking for exactly? – Carey Estes Jan 16 '14 at 15:32

2 Answers2

0

Try to dump assetic:

$  app/console assetic:dump


09:27:19 [file+] /var/www/app/../web/css/06935bc.css
09:27:19 [file+] /var/www/app/../web/css/06935bc_tags_1.css
09:27:19 [file+] /var/www/app/../web/css/06935bc_create-ui_2.css
09:27:19 [file+] /var/www/app/../web/css/06935bc_font-awesome_3.css
09:27:19 [file+] /var/www/app/../web/css/06935bc_midgardnotif_4.css
09:27:19 [file+] /var/www/app/../web/css/06935bc_halloCmfStyle_5.css
09:27:19 [file+] /var/www/app/../web/css/06935bc_createStyle_6.css
09:27:19 [file+] /var/www/app/../web/css/06935bc_overlay_7.css
09:27:19 [file+] /var/www/app/../web/js/ckeditor.js
09:27:19 [file+] /var/www/app/../web/js/ckeditor_ckeditor_1.js
09:27:19 [file+] /var/www/app/../web/js/ckeditor_init-create-ckeditor_2.js
09:27:19 [file+] /var/www/app/../web/js/ckeditor_init-create-common_3.js
09:27:19 [file+] /var/www/app/../web/js/create.js
09:27:19 [file+] /var/www/app/../web/js/create_jquery_1.js
09:27:19 [file+] /var/www/app/../web/js/create_jquery-ui_2.js
09:27:19 [file+] /var/www/app/../web/js/create_underscore_3.js
09:27:19 [file+] /var/www/app/../web/js/create_backbone_4.js
09:27:19 [file+] /var/www/app/../web/js/create_rangy-core_5.js
09:27:19 [file+] /var/www/app/../web/js/create_vie_6.js
09:27:19 [file+] /var/www/app/../web/js/create_jquery.rdfquery.core_7.js
09:27:19 [file+] /var/www/app/../web/js/create_jquery.rdfquery.rules_8.js
09:27:19 [file+] /var/www/app/../web/js/create_jquery.tagsinput_9.js
09:27:19 [file+] /var/www/app/../web/js/create_annotate_10.js
09:27:19 [file+] /var/www/app/../web/js/create_create_11.js
09:27:19 [file+] /var/www/app/../web/js/hallo-extra.js
09:27:19 [file+] /var/www/app/../web/js/hallo-extra_jquery.htmlClean_1.js
09:27:19 [file+] /var/www/app/../web/js/hallo-extra_hallo_2.js
09:27:19 [file+] /var/www/app/../web/js/hallo-extra_init-create-hallo_3.js
09:27:19 [file+] /var/www/app/../web/js/hallo-extra_init-create-common_4.js
Rubén Fanjul Estrada
  • 1,296
  • 19
  • 31
0

It is rather a workaround, as the documentation doesn't suggest this approach, but after I got into the same issue, what solved this for me was setting the extension for css files in the output attribute. By default they ended up linked without an extension.

{% stylesheets '@asset_test_css' output="css/test.css" %}
wiktus239
  • 1,404
  • 2
  • 13
  • 29