hearsayit / HearsayRequireJSBundle

RequireJS integration for Symfony2.
130 stars 55 forks source link

Fixing issues with module names not being properly resolved in FilenamesResource #39

Closed jameshalsall closed 3 years ago

jameshalsall commented 11 years ago

I was experiencing issues in my travis build process (but not locally - even when following through the travis build process locally) with module names in my paths config not being resolved to file names.

For example:

jquery: "@AcmeCoreBundle/Resources/public/js/vendor/jquery/jquery"

was not being resolved correctly to the full file path in isFresh() in Factory/Resource/FilenamesResource.php.

I've updated the logic for this. There's also a fix in there for when a path value points to a directory and not a real file.

ihortymoshenko commented 11 years ago

@jameshalsall, I'm not sure that the problem is here. I've checked the code where the resource is created. Are you sure that the file is exist? Try to look this line https://github.com/hearsayit/HearsayRequireJSBundle/blob/master/DependencyInjection/HearsayRequireJSExtension.php#L190.

jameshalsall commented 11 years ago

@IgorTimoshenko hmm, maybe its further up the chain where the problem is really being caused.

Take a look at the error I'm getting in my travis build:

https://travis-ci.org/tickit-project/tickit/jobs/9443257#L753

The config can be found here:

https://github.com/tickit-project/tickit/blob/development/app/config/require-js.yml

ihortymoshenko commented 11 years ago

@jameshalsall, It is quite strange, I'll clone your repository and try to cause the issue itself but a little bit later.

jameshalsall commented 11 years ago

@IgorTimoshenko Cheers - I ran through the .travis.yml build process myself locally and couldn't reproduce the original issue - hopefully you have better luck

jameshalsall commented 11 years ago

@IgorTimoshenko any luck reproducing this issue?

ihortymoshenko commented 11 years ago

@jameshalsall, I've caught the Composer error while trying to resolve dependencies :(

jameshalsall commented 11 years ago

@IgorTimoshenko that's weird, using the tickit repository? I will check

ihortymoshenko commented 11 years ago

@jameshalsall, yes, I'll check again.

ihortymoshenko commented 11 years ago

@jameshalsall, let me know when you fix the following:

$ composer install --dev
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.jso
n. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for symfony/icu 1.2.x-dev -> satisfiable by symfony/i
cu[1.2.x-dev].
    - symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
 to have the extension providing it.
  Problem 2
    - symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked libra
ry icu has the wrong version installed or is missing from your system, make sure
 to have the extension providing it.
    - symfony/symfony 2.3.x-dev requires symfony/icu ~1.0 -> satisfiable by symf
ony/icu[1.2.x-dev].
    - Installation request for symfony/symfony 2.3.x-dev -> satisfiable by symfo
ny/symfony[2.3.x-dev].
jameshalsall commented 11 years ago

@IgorTimoshenko you have an outdated ICU library installed in php... symfony/icu requires lib-icu >= 4.4

https://packagist.org/packages/symfony/icu

ihortymoshenko commented 11 years ago

@jameshalsall, ok, I've finally ran your application. Unfortunately, I couldn't reproduce the issue. I've also checked the code again and I don't see anything strange.

jameshalsall commented 11 years ago

@IgorTimoshenko exactly what I experienced - I can't see the difference between travis and local

ihortymoshenko commented 11 years ago

@jameshalsall, do you have any updates to this issue? I'm going to close this issue.

jameshalsall commented 11 years ago

@IgorTimoshenko I've been using my fix branch on my repo mirror - have you fixed any other issues related to this recently that might have resolved the problem?

ihortymoshenko commented 11 years ago

@jameshalsall, yes, I made some minor changes because too many files knew about the .js file extension. I think you can try. However, I cannot guarantee anything.

jameshalsall commented 11 years ago

@IgorTimoshenko looks like this issue has been fixed now I've switched to dev-master, thanks for the help!

jameshalsall commented 11 years ago

Scratch that last comment, still get the same issue in travis even though my local build is fine...

https://travis-ci.org/tickit-project/tickit/jobs/11628874#L877

It's obviously something related to the travis environment that is causing it, just not sure what