Open mystix opened 10 years ago
Thanks, I fixed that. I keep getting the same error from node.js, though. Also, still can't find api.example.com/products
What do you see when you go to the /products page?
I was able to make the /products page work, by tweaking the vhost files.
I can see the product JSON string now. However, running node node/service.js I still throws the following error:
node node/server.js !337
SyntaxError: Unexpected token u
at Object.parse (native)
at Request._callback (/var/www/moa/node/server.js:24:21)
at self.callback (/var/www/moa/node_modules/request/request.js:122:22)
at Request.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (/var/www/moa/node_modules/request/request.js:231:10)
at ClientRequest.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.emit (events.js:95:17)
at net.js:833:16
at /var/www/moa/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:177:31
Any ideas?
Does your node server know how to resolve api.example.com to the correct IP?
Yes, it's working now. I can see the products in the store page.
I'm having a slightly different issue now. When the page loads, there are some requests that are failing.
You can see them in the image below
I installed MoA on a VM, so I'm redirecting port 8080 on the host to port 80 on the guest.
If I access to GET http://api.dev:8080/basket, for example, it works. How can I set that internally so those requests are made through port 8080 instead of 80?
You can edit the config.json to add :8080 to the URLs -- let me know if that works
Raja Kapur
On Thu, Jul 24, 2014 at 12:39 PM, red5code notifications@github.com wrote:
Yes, it's working now. I can see the products in the store page.
I'm having a slightly different issue now. When the page loads, there are some requests that are failing.
You can see them in the image below
I installed MoA on a VM, so I'm redirecting port 8080 on the host to port 80 on the guest.
If I access to GET http://api.dev:8080/basket, for example, it works. How can I set that internally so those requests are made through port 8080 instead of 80?
— Reply to this email directly or view it on GitHub https://github.com/Wildhoney/Magento-on-Angular/issues/74#issuecomment-50044035 .
When I add the port to the api host value like this:
"api": { "host": "http://api.dev:8080", "provider": "magento" }
I start getting the "Unexpected token u" error from node again. That happens because the request to get the products in the node server fails (since locally it's accessing the url through port 80)
I added a new vhost to answer requests through port 8080 and now it's working. Thanks for your help @aonic!
:+1:
I am getting this error
SyntaxError: Unexpected token D
at Object.parse (native)
at Request._callback (D:\xampp\htdocs\ang\node\server.js:24:21)
at Request.self.callback (D:\xampp\htdocs\ang\node_modules\request\request.j
s:122:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.
Please suggest solutions.
Hi, I am also getting the "SyntaxError: Unexpected token <" error when trying to run node/server.js, full error here:
SyntaxError: Unexpected token <
at Object.parse (native)
at Request._callback (/var/www/html/moa/node/server.js:24:21)
at Request.self.callback (/var/www/html/moa/node_modules/request/request.js:122:22)
at Request.emit (events.js:98:17)
at Request.
However when I hit api.example.com i get this php error, which is also in the apache logs:
Warning: require(/var/www/html/moa/api/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/moa/api/bootstrap/autoload.php on line 17
Fatal error: require(): Failed opening required '/var/www/html/moa/api/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/moa/api/bootstrap/autoload.php on line 17
from apache:
[Wed Sep 10 16:28:07.915658 2014] [:error] [pid 30558] [client 127.0.0.1:33668] PHP Warning: require(/var/www/html/moa/api/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/moa/api/bootstrap/autoload.php on line 17
what is this /vender/autoload.php about?
Any help would be appreciated.
Hi, Getting following error:
Error: _ is not defined resolve@http://localhost/Fast/Magento-on-Angular/store/js/services/Gateway.js:36:13 contentUpdated/<@http://localhost/Fast/Magento-on-Angular/store/js/controllers/ProductsController.js:147:35 $RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost/Fast/Magento-on-Angular/store/bower_components/angular/angular.js:12811:16 $RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost/Fast/Magento-on-Angular/store/bower_components/angular/angular.js:12909:18 contentUpdated@http://localhost/Fast/Magento-on-Angular/store/js/controllers/ProductsController.js:143:13 EventEmitter.prototype.emit@http://localhost/Fast/Magento-on-Angular/store/bower_components/socket.io-client/dist/socket.io.js:633:7 SocketNamespace.prototype.onPacket@http://localhost/Fast/Magento-on-Angular/store/bower_components/socket.io-client/dist/socket.io.js:2248:9 Socket.prototype.onPacket@http://localhost/Fast/Magento-on-Angular/store/bower_components/socket.io-client/dist/socket.io.js:1930:5 Transport.prototype.onPacket@http://localhost/Fast/Magento-on-Angular/store/bower_components/socket.io-client/dist/socket.io.js:1332:5 Transport.prototype.onData@http://localhost/Fast/Magento-on-Angular/store/bower_components/socket.io-client/dist/socket.io.js:1303:11 WS.prototype.open/this.websocket.onmessage@http://localhost/Fast/Magento-on-Angular/store/bower_components/socket.io-client/dist/socket.io.js:2378:7
http://localhost/Fast/Magento-on-Angular/store/bower_components/angular/angular.js Line 10126
Have a look in attached screenshot !
_
being undefined is due to the Underscore dependency not being included :+1:
Thank you @Wildhoney
Its working now !
Currently code wrote upto cart. No logic for checkout right ?
Sadly that's right – any pull requests relating to checkout gleefully merged!
I'm running node 0.10.26 + npm 1.4.7 (installed using mxcl/homebrew) on OSX 10.9.2.
Tried to get
moa
up and running using the instructions from the Getting Started section of the README, but kept encountering the following error duringnpm install
:Managed to workaround this by changing the
dependencies
list inpackage.json
to:then tried to Initialise the Node.js instance: node node/server.js; but encountered the following error:
Any ideas what I'm doing wrong?