简体   繁体   English

Symfony2资产导致javascript错误

[英]Symfony2 assetic cause javascript error

I have a problem, I'm there two days without being able to solve it: 我有一个问题,我有两天没能解决它:

I have a page with twig using javascripts, prod and gives error on the page, does not give error on dev 我有一个页面用twigs使用javascripts,prod并在页面上给出错误,不会在dev上给出错误

I tried using assetic and gives error 我尝试使用资产并给出错误

I've tried taking the asset files from the web, also gives error 我试过从网上获取资产文件,也给出了错误

the base file: http://pastebin.com/Xyjg0U0L 基本文件: http//pastebin.com/Xyjg0U0L

the page the error: http://pastebin.com/Vj73EuPk 页面错误: http//pastebin.com/Vj73EuPk

dev.itenho.com.br/ dev.itenho.com.br/

dev.itenho.com.br/app_dev.php dev.itenho.com.br/app_dev.php

I've compared the two versions of html and css in ubuntu meld and is identical 我在ubuntu meld中比较了html和css的两个版本并且是相同的

I just can guess since your error description is a bit vague. 我只能猜测,因为你的错误描述有点模糊。

But this is a "classic" one when you have errors with assetic in your prod env: 但是当你的prod env中有资产错误时,这是​​一个“经典”的:
You can do two things: 你可以做两件事:

Try to add in your config_prod.yml: 尝试添加config_prod.yml:

assetic:
    use_controller: true

or call: 或致电:

php app/console assetic:dump --env=prod --no-debug

I had the same problem and I solved it with a semicolon ; 我有同样的问题,我用分号解决了; at the end of the js file. 在js文件的末尾。 Check all your js file and put a semicolon ; 检查所有js文件并加上分号; at the end of those file that no has one. 在那些没有的文件的末尾。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM