0

One component in the React lib is auto-loading, but the majority are not.

I Composed react/react into my project, and everything in that process went smoothly.
Upon trying to use React\EventLoop\Factory or React\Stream\Stream, a "class not found" error is thrown.
I switched on xDebug and noticed that the Composer\Autoload\ClassLoader->prefixes['R'] array includes React\Promise ... but nothing else.
It seems to me that other React libs should be in there, too.

Seeing that, I var_dumped \React\Promise\any('string') and it successfully autoloaded the React\Promise namespace. Still, the classes under the other React\ namespaces fail to autoload.
I can't help but suspect that my problem is in some related way to their distinct absence from the Composer\Autoload\ClassLoader->prefixes array, but being fairly novice, that's just a hunch.

BTW, just to make sure everything was at least accessible, I did try hard-coded require's on those classes. It succeeded (other than the subsequent dependencies not being autoloaded, of course :)

What do you suspect could be causing this type of kinda/kinda-not autoloading?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
mOrloff
  • 2,547
  • 4
  • 29
  • 48
  • Have you tried to generate the autoloader again? Try `composer -o dump-autoload`. – Diego Agulló Feb 22 '14 at 10:42
  • Haven't, thanks. I will, and I'll post back. .. Oh!, BTW, I forgot to mention that, while exploring. I _did_ look at `installed.json`, and it does show the `react/react` lib in there. I'll try your suggestion regardless, and post back. – mOrloff Feb 24 '14 at 16:55
  • Yay!! it works. Thanks @DiegoAgulló. The project got shelved for a bit. I just got back into it today and wanted to post back here to say thanks. – mOrloff Mar 21 '14 at 23:59

0 Answers0