Closed joshhornby closed 9 years ago
I have created an example repo which shows the issue
Can you see in the logs if there's something about it ?
The logs are empty. Have you got a spare 5 mins to create an example working project? I can pull it down and compare with mine?
Damn, it is really not rendering. Apparently it's not a error with react-laravel
, I've tried to downgrade it in my test project and it keeps happening, I guess it's something with some update at Laravel framework, gonna check it soon and answer here, thanks !
Any update on this @talyssonoc?
Not yet, @joshhornby :disappointed:, I've tried to open a issue about it (https://github.com/laravel/framework/issues/8990), but they don't seen to want to help too much...
I'm thinking about to create a version for Laravel 5.1, I guess this will work properly, do you have interest in it ? (But I'll still try to work with 5.0).
5.1 would be perfect for our dev team.
If you need any help I'd happily contribute just ping me! :+1:
Gonna do it soon !
In case you're interested, I've developed a package that connects Phactory and Laravel (it's specially useful for Laravel 5.0, since Laravel 5.1 already has support for factories), you can check it here: https://github.com/talyssonoc/phactory-laravel
Solved, @joshhornby !
Still isn't working for me, I am think this maybe a namespace clash with https://github.com/reactphp/promise. As you can see the whole ReactPHP project uses the React namespace.
Damn, for me it's working fine (at least at Laravel 5.1). But I also think it could be because of ReactPHP. The error is the same ? The directive doesn't get rendered ? (Did you changed the version from 0.9 to 0.9.1 at your composer.json ?)
I have 0.9.1 in my composer. Are you using Homestead to serve your site? I have v8js installed on Homestead but not on my local mac only on my VM, do you think this may be causing the issues?
Yes, I'm using Homestead, and v8js
got to be installed just where the server is (i.e. Homestead), I don't think this may be the reason.
Can you check at your composer.lock if v0.9.1 was properly installed ? Also, can you check if the content of vendor/talyssonoc/react-laravel/lib/ReactServiceProvider.php
is exactly like this file ?
I have updated my project which can be found here: https://github.com/joshhornby/react-laravel-example
The file was the same.
This project doesn't have the React namespace clash. Can you create a sample project and push up? If it works on your end and not mine then chances are my set up is incorrect.
Sure I can ! Here it is: https://github.com/talyssonoc/react-laravel-example
Didn't work for me, must be something at my side then!
@joshhornby maybe something with the last version of V8 ?
@a-moses Are you having the same issue? What version do you have installed on homestead @talyssonoc
@joshhornby, I'm using Homestead 2.0.14
@talyssonoc Same here. I simply have just done
$ sudo apt-get install libv8-dev g++
$ sudo pecl install v8js-0.1.3
inside my homestead box. But when ever I load your example I just see the @react_component as a string.
@joshhornby weird... I've tested it with v8js 0.1.3 and 0.2.0 (you can se how to install it here).
Try to delete your vendor
folder and run composer update
again.
I have added some logs into your service provider, and it seems the service provider is not getting picked up. Any reason why this might happen?
I don't know exactly, it should be working, can you show me your composer.json
?
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"talyssonoc/react-laravel": "0.9.1"
},
And the lock file
{
"name": "talyssonoc/react-laravel",
"version": "v0.9.1",
"source": {
"type": "git",
"url": "https://github.com/talyssonoc/react-laravel.git",
"reference": "2e0f65a9630f917914d032cac2c1b4c437a869ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/talyssonoc/react-laravel/zipball/2e0f65a9630f917914d032cac2c1b4c437a869ae",
"reference": "2e0f65a9630f917914d032cac2c1b4c437a869ae",
"shasum": ""
},
"require": {
"illuminate/support": "~5.0",
"reactjs/react-php-v8js": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "~4.0.0@stable"
},
"type": "library",
"autoload": {
"classmap": [
"facades/"
],
"psr-4": {
"React\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Talysson Oliveira",
"email": "talyssonoc@gmail.com"
}
],
"description": "Package to use ReactJS with Laravel",
"keywords": [
"laravel",
"react",
"reactjs"
],
"time": "2015-06-11 13:00:14"
},
Well, that's weird... Did you registered the service provider on your config file ? Do it and then restart your php5-fpm
service.
Yes, I am using the example you provided above. All I am seeing on screen is @react_component('Message', [ 'name' => 'Hue' ])
And the html looks like so
<html>
<head>
<script src="{{ asset('vendor/react-laravel/react.js') }}"></script>
<script src="{{ asset('js/components.js') }}"></script>
<script src="{{ asset('vendor/react-laravel/react_ujs.js') }}"></script>
</head>
<body>
@react_component('Message', [ 'name' => 'Hue' ])
</body>
</html>
Damn, that's really weird, it should be working. @a-moses, that's what is happening to you too ?
http://laravel.com/docs/5.1/blade#extending-blade Have you seen this @talyssonoc
I've seen, @joshhornby, but the Blade::directive
doesn't exist at Laravel 5.0, I've tried to make it work with both 5.0 and 5.1 and in the Laravel repository I was told it would work.
Can you screen shot what you are seeing on your screen? Might also worth re opening this issue.
Sure, @joshhornby, here it is:
I'm thinking about that, just wanna know if it is happening because of yours configs or a bug.
If you run composer update
outside of your homestead ssh do you get an error?
You mean, run composer update
from the host machine ?
Yeh
Nope, it runs correctly because I also have v8js
in my host machine (but it is not necessary, but in this case I don't get a error because composer would check the dependencies like v8js in the host machine, if you run it from ssh it will check the dependencies inside homestead machine.
Not sure this is the case, I have the following error when running composer update outside on the VM:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- talyssonoc/react-laravel v0.9.1 requires reactjs/react-php-v8js dev-master -> satisfiable by reactjs/react-php-v8js[dev-master].
- talyssonoc/react-laravel v0.9.1 requires reactjs/react-php-v8js dev-master -> satisfiable by reactjs/react-php-v8js[dev-master].
- reactjs/react-php-v8js dev-master requires ext-v8js >=0.1.3 -> the requested PHP extension v8js is missing from your system.
- reactjs/react-php-v8js dev-master requires ext-v8js >=0.1.3 -> the requested PHP extension v8js is missing from your system.
- Installation request for talyssonoc/react-laravel 0.9.1 -> satisfiable by talyssonoc/react-laravel[v0.9.1].
Yes, it's because of this, but it its bease your host machine doesn't have v8js, but it is not needed, you should run composer update
from inside your homestead machine.
Yes that is what I thought, but was just checking because I can't think of a reason why this isn't working!
Have you tried installing v8js in your physical machine and run your Laravel server from it, without using Homestead ?
@talyssonoc I compiled V8 from the source and all work well as expected until make-test failed.
It will happen depending on your machine, try to make install
anyway and see if it works, @a-moses
@talyssonoc of course i tried and v8 didn't work . we need to find the stable version for ubuntu homestead
v8js 0.2.1
is out and I tried with Laravel 5.1 and react-laravel 0.9.1
still not working...
I just tried {!! React::render('Message', [ 'name' => 'Hue' ], [ 'prerender' => true ]) !!}
and it works!
@joshhornby @a-moses @18601673727 Can you try this instructions here and say me if it does work? https://github.com/talyssonoc/react-laravel/issues/41#issuecomment-133704745
Hey,
This package looks great but I can't get it to work, I have followed the docs line for line but when it comes to including
@react_component('Message', [ 'title' => 'Hello, World' ], [ 'prerender' => true ])
inside a blade file it just print it out as if its a string.Is this a known fault or something I am doing incorrectly? Like I say I have followed the guide word for word.
Thanks