Closed ben-gibson closed 1 year ago
We're facing the same issue (but not on Heroku, just locally).
In our team 2 instances (one on Windows, one on Ubuntu) works ok after implementing bundle:
# @see https://github.com/Spea/SpBowerBundle/blob/master/Resources/doc/configuration_reference.md
sp_bower:
assetic:
enabled: true
nest_dependencies: false
bundles:
MyBundle:
config_dir: Resources/config
asset_dir: ../public/bower_components
cache:
directory: ../public/bower_components/.cache
Two other instances (both Windows) does not work with the same config.
Bower 1.3.12 everywhere, PHP version differs (5.5.9 and 5.5.11 works, 5.5.15 does not) (doesn't matter, see below).
We have been debugging this issue deeply and here's what we got:
createDependencyMappingCache()
, $config->getCache()->save()
returns false
.\Doctrine\Common\Cache\FileCache::writeFile()
- @rename($tmpFile, $filename))
returns false
$filename
has length 199, coworker's is 214 (not trimmed), when he want to manually enter filename Windows allows only [6f388c544181a2e4e614e2b3de6e2cb28b73c45d][1].sp_bowe
.And now the question: maybe SpBowerBundle can get rid of those nested cache directories (like c7\d0\c9\65\19\0e\d3\ca\e5\80\7c\63\78\f7\72\1f\2f\ae\1a\a1\92\0e\3e\c4\7e\62\48\6b\99\f4\23\04
) to shorten file path?
In my case, the path length is equal to 266 characters. It is too long for Windows.
Maximum Path Length Limitation
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
Solution: This occurs on Windows due to how Doctrine's FileCache splits a sha256 hash when generating the filename. You can use my solution here
When I try to deploy my Application to Heroku I get the error shown at the bottom of this issue. I have the post and update commands from the documentation in my composer.json file and have tried using 'install_on_warmup: true' to no avail.
All the composer scripts appear to run fine without error:
Creating the "app/config/parameters.yml" file Clearing the cache for the prod environment with debug false Installing bower dependencies for "AcmeTestBundle" into "/tmp/build_3c875b1bbb971f81580aacddf2e3e8ea/src/Acme/Bundle/TestBundle/Resources/config/bower/../../public/components" Trying to install assets as symbolic links. Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework The assets were installed using symbolic links. Installing assets for Acme\Bundle\TestBundle into web/bundles/acmetest The assets were installed using symbolic links.
CRITICAL: Uncaught PHP Exception Twig_Error_Syntax: "An exception has been thrown during the compilation of a template ("Dependency cache keys not yet generated, run "app/console sp:bower:install" to initiate the cache: Cached dependencies for "/app/src/Acme/Bundle/TestBundle/Resources/config/bower" not found, create it with the method createDependencyMappingCache().")