Как исправить "файл манифеста не существует".в Symfony4 - PullRequest
0 голосов
/ 23 января 2019

Я работаю над проектом в Symfony 4.2 с Webpack. Я версионирую свой код с помощью BitBucket и использую heroku для своего развертывания. Приложение очень хорошо работает в среде разработки на моей локальной машине. Но у меня ошибка в режиме производства на Heroku. Сервер не может найти файл manifest.json, и мои файлы активов генерируют 404 ошибки.

Вот содержимое моего конфигурационного файла assets.yaml:

framework:
    assets:
        json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'

Ниже приведены ошибки, которые у меня есть:

2019-01-23T14:17:36.377047+00:00 app[web.1]: [2019-01-23 14:17:36] request.INFO: Matched route "app_login". {"route":"app_login","route_parameters":{"_route":"app_login","
_controller":"App\\Controller\\SecurityController::login"},"request_uri":"http://**********.herokuapp.com/","method":"GET"} []
2019-01-23T14:17:36.377226+00:00 app[web.1]: [2019-01-23 14:17:36] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"main","authenticators":1
} []
2019-01-23T14:17:36.377448+00:00 app[web.1]: [2019-01-23 14:17:36] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"main","authenticator":"App\\Se
curity\\LoginFormAuthenticator"} []
2019-01-23T14:17:36.377787+00:00 app[web.1]: [2019-01-23 14:17:36] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"main","authenticator"
:"App\\Security\\LoginFormAuthenticator"} []
2019-01-23T14:17:36.379214+00:00 app[web.1]: [2019-01-23 14:17:36] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
**2019-01-23T14:17:36.379828+00:00 app[web.1]: [2019-01-23 14:17:36] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the re
ndering of a template ("Asset manifest file "/app/public/build/manifest.json" does not exist.")." at /tmp/build_6b468a926db1e3ce965958cbead3b64f/templates/base.html.twig l
ine 8 {"exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"Asset manifest file \"/app/public/build/manif
est.json\" does not exist.\"). at /tmp/build_6b468a926db1e3ce965958cbead3b64f/templates/base.html.twig:8, RuntimeException(code: 0): Asset manifest file \"/app/public/buil
d/manifest.json\" does not exist. at /app/vendor/symfony/asset/VersionStrategy/JsonManifestVersionStrategy.php:57)"} []
2019-01-23T14:17:36.380146+00:00 app[web.1]: 10.92.136.3 - - [23/Jan/2019:14:17:36 +0000] "GET / HTTP/1.1" 500 918 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebK
it/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36**

Я также пытался отключить доступ к файлу manifest.json в конфигурационном файле assets.yaml. И я получаю 404 ошибки в моих файлах активов:

2019-01-23T15:45:20.646929+00:00 app[web.1]: 10.10.240.248 - - [23/Jan/2019:15:45:20 +0000] "GET / HTTP/1.1" 200 3878 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleW
ebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

2019-01-23T15:45:20.821244+00:00 app[web.1]: 10.10.240.248 - - [23/Jan/2019:15:45:20 +0000] "GET /build/app.css HTTP/1.1" 404 211 "https://***********.herokuapp.com/" "M
ozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

    2019-01-23T15:45:20.830189+00:00 app[web.1]: 10.13.65.189 - - [23/Jan/2019:15:45:20 +0000] "GET /build/libs/jquery/tether/dist/js/tether.min.js HTTP/1.1" 404 244 "https://
    caisse-fitfit.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
    2019-01-23T15:45:20.962711+00:00 app[web.1]: 10.10.240.248 - - 
[23/Jan/2019:15:45:20 +0000] "GET /build/libs/jquery/underscore/underscore-min.js HTTP/1.1" 404 244 "https:/
    /*************.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
    2019-01-23T15:45:20.976373+00:00 app[web.1]: 10.13.65.189 - - 
[23/Jan/2019:15:45:20 +0000] "GET /build/libs/jquery/jQuery-Storage-API/jquery.storageapi.min.js HTTP/1.1" 40
    4 259 "https://*********.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

    2019-01-23T15:45:21.001653+00:00 app[web.1]: 10.37.18.194 - - [23/Jan/2019:15:45:21 +0000] "GET /build/libs/jquery/PACE/pace.min.js HTTP/1.1" 404 232 "https://caisse-fitfi
    t.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
    2019-01-23T15:45:21.111050+00:00 app[web.1]: 10.10.240.248 - - [23/Jan/2019:15:45:21 +0000] "GET /build/scripts/config.lazyload.js HTTP/1.1" 404 230 "https://************
    .herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
    2019-01-23T15:45:21.121765+00:00 app[web.1]: 10.13.65.189 - - [23/Jan/2019:15:45:21 +0000] "GET /build/scripts/palette.js HTTP/1.1" 404 222 "https://***********.herokuap
    p.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
    2019-01-23T15:45:21.153872+00:00 app[web.1]: 10.37.18.194 - - [23/Jan/2019:15:45:21 +0000] "GET /build/scripts/ui-load.js HTTP/1.1" 404 222 "https://caisse-fitfit.herokuap
    p.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
    2019-01-23T15:45:21.160011+00:00 app[web.1]: 10.10.240.248 - - 

Я протестировал несколько решений, найденных в сети, но ни одно из них не работает. (

...