Comments (8)
cc @aomarks
Thanks for the report. Does it take a while to render the page? It may be hitting a timeout, or there could be a different bug with the middleware.
Do you have anything that could help us reproduce this? eg. a polymer 2 app that you reproduce this with?
from rendertron.
this error pops up as soon as the bot request is made. it probably has nothing to do with the 10 sec rendering time.
the code below is in server.js
const express = require ('express');
const app = express();
const bodyParser = require ('body-parser');
const path = require('path');
const rendertron = require('rendertron-middleware');
let port = process.env.PORT || 1337;
app.use(bodyParser.urlencoded({extended: true}));
app.use('/bower_components', express.static(path.join(__dirname, 'bower_components')));
app.use('/src', express.static(path.join(__dirname, 'src')));
app.use(rendertron.makeMiddleware({
proxyUrl: 'localhost:3000/render',
injectShadyDom: true,
}));
app.use(express.static('files'));
app.get('/', function(req,res){
res.sendFile(path.resolve(__dirname, 'index.html'));
});
app.listen(port, function(){
console.log('listening to ' + port);
});
and the index.html and the file structure is the same as
polymer init
then select polymer 2 application
I also tested it by deploying the app on heroku and using https://render-tron.appspot.com/render/
as end point.
when a bot request is made, it has this <my-app></my-app>
in the body tag
but there is simply nothing inside my-app tag, not even a shadown dom.
but https://render-tron.appspot.com/render/
can actually render my heroku page correctly.
I also checked heroku logs. and it didn't show any error. when i search the logs it couldn't find any result for 'render' as well.
from rendertron.
@hekod777: it looks like http://
is missing from proxyUrl
in that code sample. Can you try it with the full URL?
from rendertron.
Thank you for the advise. now the error is gone. and after adding some console.logs in rendertron. I can see that if a bot sends a request to my app. it will hit the rendertron/render end point.
and rendertron actually successfully rendered the page with a status code of either 200 or 304.
but whats inside <my-app></my-app>
is still empty.
it seems that there are some problems with serving the rendered html to the bot?
also when I try to deploy my app, and use https://render-tron.appspot.com/render as end point, I got the same result (nothing inside my-app tag) when I tried to visit my app on heroku using a bing bot.
this is what i see in the heroku log
2017-08-29T20:08:33.720361+00:00 app[web.1]: https://render-tron.appspot.com/render/http%3A%2F%2Fboiling-tor-88178.herokuapp.com%2F?wc-inject-shadydom
from rendertron.
interesting
after adding '=true' in the rendertron-middleware and make the code
if (injectShadyDom) {
renderUrl += '?wc-inject-shadydom=true';
}
everything worked!
from rendertron.
I saw the same problem too. Here is the PR: #82
from rendertron.
Thanks @hekod777, @frankiefu, let me know if there's further issues.
from rendertron.
The fix will be released in middleware 0.1.2. #83
from rendertron.
Related Issues (20)
- Server not responding after running 1 or 2 days, suspect memory leak HOT 3
- Script monitor-inspect points to non existing file src/main.js HOT 1
- the memory of chrome process keeps increasing HOT 3
- Rendertron on Google Cloud Platform - Cloud Run HOT 1
- Rendertron returning base href of Angular application as "https://null" HOT 3
- Password protection / authentication HOT 1
- restrictedUrlPattern does not exist in the latest published npm package 3.1.0 HOT 1
- [Project Status?] Is @AVGP still working on this project? HOT 8
- Website has css missing and API calls don't get fulfilled when rendering it through Rendertron HOT 2
- Question: What is the reason of cutting pathname in rendertron which is used in <base> as a page default URL HOT 2
- Set custom user agent HOT 1
- cant get rendertron to work. HOT 1
- Case-sensitivity of refreshCache HOT 1
- Build is failing - is this project still maintained? HOT 3
- SSRF on rendertron HOT 1
- Add timeout options for screenshots HOT 3
- ERROR: newTree.optimize is not a function
- problem with metadata HOT 1
- Not working for deep pages HOT 1
- https://render-tron.appspot.com/ is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rendertron.