Comments (26)
Are you looking at generated html or browser output?
from react-snap.
The generated html
On viewing source in the browser, it shows the same.
from react-snap.
This is a strange bug. I will need reproducible demo for this.
https://github.com/stereobooster/react-snap/blob/master/index.js#L174
from react-snap.
I am currently using code-splitting with react-snap
react-snap.zip
from react-snap.
This is what I see (in given example)
<link href="/static/css/app.fb2d5da5.css" rel="preload" as="style" onload="this.rel='stylesheet'">
which is correct
from react-snap.
Which OS are you using?
I think puppeteer doesn't work well with all OS's
from react-snap.
I use MacOS X. Which system do you use?
from react-snap.
I have two systems. The link preload works on windows 10 but not on Ubuntu.
from react-snap.
Ok I will check Ubuntu. But this will take some time
from react-snap.
Thank you.
And is it possible to use PhantomJS instead of Puppeteer?
from react-snap.
is it possible to use PhantomJS instead of Puppeteer?
Doesn't make any sense. PhantomJS (theoretically) have much more bugs. Puppeteer is official product of Chrome team. If we will be able to prove this is the bug of Puppeteer we can open issue in their tracker
from react-snap.
This error also came up once
Crawled 3 out of 5 (/about)
(node:3300) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ReferenceError: webpackJsonp is not defined
at http://localhost:45674/static/js/home.c6d8ef6f.chunk.js:1:1
(node:3300) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Is this error causing the problem?
from react-snap.
this error is caused by webpack dynamic import https://github.com/stereobooster/react-snap#webpack-2-and-dynamic-import. I want to change it so this option would be enabled by default see #36
from react-snap.
I found this on line 207 in the fixWebpackChunksIssue
method
const mainRegexp = /main\.[\w]{8}.js/;
But create-react-app generates a bundle.js
. So shouldn't the code be
const mainRegexp = /bundle\.[\w]{8}.js/;
from react-snap.
which version of c-r-a do you use? I wonder when this changed
from react-snap.
I am using [email protected]
from react-snap.
Version of react-scripts?
from react-snap.
1.0.16
from react-snap.
still can not reproduce
this is my Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "shell", inline: <<-SHELL
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get update
apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
apt-get install -y nodejs
apt-get install -y build-essential
cd /vagrant
npm install
SHELL
end
vagrant up
vagrant ssh
cd /vagrant
npm run-script build
node -v
v8.9.1
npm -v
5.5.1
from react-snap.
If I comment out link.setAttribute("onload", "this.rel='stylesheet'");
, the rel propery is set to preload. Otherwise it remails 'stylesheet'
from react-snap.
this is how it suppose to be. Read about async style loading https://www.npmjs.com/package/fg-loadcss
from react-snap.
I reproduced it on Windows 8.1 and Arch Linux. Seems to be platform specific.
I also get this error on Windows 8.1
ERROR: The process with PID 3544 (child process of PID 3896) could not be terminated.
Reason: The operation attempted is not supported.
(node:3092) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Command failed: taskkill /pid 3896 /T /F
ERROR: The process with PID 3544 (child process of PID 3896) could not be terminated.
Reason: The operation attempted is not supported.
from react-snap.
link.setAttribute("onload", "this.rel='stylesheet'");
In the above line, the onload code is being executed as I also tried another line
link.setAttribute("onload", "this.rel='alternate stylesheet'");
The rel property was set to
rel="alternate stylesheet"
from react-snap.
As of windows problem - I can not help with that. I do not have windows machine. Try to look similar problem in puppeteer.
As of link.setAttribute
not sure what you want to change. This is intended behaviour. Read about async css load technique by Filament Group, Inc. You can easily change this, by creating your own fork. This npm package is installable via git - it does not have compilation steps.
from react-snap.
Is it possible to omit pages to be prerendered. Like the profile page is user-specific so ideally that should not be preloaded.
from react-snap.
but how crawler gets to this page? don't you need to be loged in?
from react-snap.
Related Issues (20)
- pagerror and incomplet crawled page with firestore HOT 4
- Problem with access to sitemap.xml
- Error in postbuild when using react-snap
- pageerror at /: SyntaxError: Unexpected token '.' HOT 8
- It is not rendering my css file on my 404 page HOT 1
- options.waitFor freezes crawling/rendering
- YouTube Video Embed Causing Error: DOMEXception: A network error occured. HOT 1
- Home page always being returned HOT 7
- Getting Same Page source for every page HOT 3
- Continue on error HOT 1
- Disable Crawling External JS such as Adsense and Analytics
- Support Vite.JS HOT 4
- Who uses it HOT 4
- There is a phenomenon in which the build does not end in the GitHub Actions (Linux Latest) environment. HOT 9
- React 18 not working ! HOT 10
- Not able to deploy on AWS Amplify HOT 3
- react-snap vulnerability
- SyntaxError: Unexpected token '?' HOT 8
- Getting react-app to work
- Prime React UI Kit Not Working With React Snap HOT 1
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 react-snap.