sylius:站点未在生产中正确部署
我开发了一个基于 sylius 的站点,在开发环境中一切正常,但在生产环境中部署时出现了一些问题:
I've developed a sylius based site and all is working fine in development environment, but some problems have arisen when deploying it on the production environment:
在前端:编译的frontend.js返回一个错误:
In Frontend: compiled frontend.js return an error:
(function ($) { Uncaught TypeError: undefined is not a function frontend.js:27(匿名函数)
(function ($) { Uncaught TypeError: undefined is not a function frontend.js:27 (anonymous function)
jquery 1.8.0 包含在产生错误的行之前.
jquery 1.8.0 is included before the line that produces the error.
在后端:似乎没有出现错误,但选择的小部件没有呈现(都没有).
In Backend: no errors seems to arise but select widgets doesn't render (none of them).
在 prod 中部署站点的步骤是:
The steps done to deploy the site in prod were:
- 迁移了数据库.
安装在生产环境中:
- Migrated the database.
Installed in production environmnet:
php app/console sylius:install -e prod
清除并预热缓存:
Cleared and warmed up the cache:
php app/console cache:clear --env=prod --no-debug
php app/console cache:warmup --env=prod --no-debug
倾销的资产:
Dumped assets:
php app/console assetic:dump --env=prod
奇怪的是,当 app.php 中的 debug 参数设置为 true 时,这些错误都不会出现.
Curiously, when debug parameter is set to true in app.php none of these errors arise.
非常感谢您的帮助!
您应该使用 no-debug 选项运行 Assetic dump 命令.php app/console assetic:dump --env=prod --no-debug
.
You should run Assetic dump command with the no-debug option. php app/console assetic:dump --env=prod --no-debug
.