question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server-Side Rendering with PHP V8Js (without node.js)

See original GitHub issue

Feature description

PHP V8Js allows to execute JS server side. It is some sort of alternative to node.js.

Currently it is not possible to execute Vue.js this way. It complains that “setTimeout” & “document” are not defined.

As Vue.js is running fine server side with node.js it should be possible to run it with PHP V8Js.

Code sample

`<?php

$vueSource = file_get_contents(‘https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js’); $v8 = new V8Js(); $result = $v8->executeString($vueSource); ?>`

Result

V8Js::executeString():5628: ReferenceError: document is not defined"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:10
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

31reactions
brataocommented, Dec 5, 2016

This is also a major decision blocker between React and Vuejs. The react have a v8js plugin and works perfectly. I can allocate sometime next week to look if I can get any workaround. But if anyone have any progress in this use case, please inform here in this topic

13reactions
neronmooncommented, Apr 11, 2017

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server side rendering JavaScript from PHP \ Seb De Deyne
Server side rendering is a hot topic when it comes to client side ... The first option that comes to mind to run...
Read more >
Server-Side Rendering with PHP V8Js (without node.js)
PHP V8Js allows to execute JS server side. It is some sort of alternative to node.js. Currently it is not possible to execute...
Read more >
How I created the server-side rendering for my website.
Today I'm going to tell you about my solution to get your JavaScript apps (and not even JavaScript!) prerendered. That's my first post...
Read more >
React.js server side rendering with PHP - Stack Overflow
To make it search engine friendly, I need it to be rendered initially on the server (serverside-rendering). The only way to do this,...
Read more >
Isomorphic React.js with PHP server-side rendering
js apps wanting to do server-side rendering, but without using Node.js or Express.js. What you'll want to do is: 1. Install V8Js PHP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found